#%RAML 0.8
title: STPowerMeter
version: v1.1.1-20161122
schemas:
- Consumption: |
    {
      "id": "http://www.samsung.com/schemas/x.com.st.powermeter.json#",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Power Meter",
      "definitions": {
        "x.com.st.powermeter": {
          "properties": {
            "power": {
              "type": "number",
              "description": "ReadOnly, Energy consumed"
            },
            "unit": {
              "type": "string",
              "enum": [
                "w",
                "kw",
                "mw"
              ],
              "description": "The current state of unit"
            }
          }
        }
      },
      "type": "object",
      "allOf": [
        {
          "$ref": "oic.core.json#/definitions/oic.core"
        },
        {
          "$ref": "oic.baseResource.json#/definitions/oic.r.baseResource"
        },
        {
          "$ref": "#/definitions/x.com.st.powermeter"
        }
      ],
      "required": [
        "power",
        "unit"
      ]
    }
traits:
- interface:
    queryParameters:
     if:
          enum: ["oic.if.baseline","oic.if.s"]
/powerMeter:
  description: This resource describes the energy consumed by the device as reported by the power meter.
  displayName: Power Meter
  is: [ interface ]
  get:
    description: |
      Provides the current power consumption reported by meter.
    responses:
      200:
        body:
          application/json:
            schema: Consumption
            example: |
              {
                "rt":     "x.com.st.powermeter",
                "id":     "unique_example_id",
                "power":  2000,
                "unit": "kw"
              }
