w3c / wot-profile

Web of Things (WoT) Profile
http://w3c.github.io/wot-profile/
Other
16 stars 8 forks source link

HTTP SSE Profile example properties missing `op` and `subprotocol` #370

Closed benfrancis closed 1 month ago

benfrancis commented 1 year ago

During implementation I've noticed that in Example 23 the Forms of the property affordances are missing the necessary op and subprotocol values to distinguish them as observeable properties in the SSE Profile.

The properties portion of the example Thing Description should read as follows:

"properties": {
    "on": {
      "type": "boolean",
      "title": "On/Off",
      "description": "Whether the lamp is turned on",
      "forms": [
        {
          "op": ["observeproperty", "unobserveproperty"],
          "href": "properties/on",
          "subprotocol": "sse"
        }
      ]
    },
    "level" : {
      "type": "integer",
      "title": "Brightness",
      "description": "The level of light from 0-100",
      "unit": "percent",
      "minimum" : 0,
      "maximum" : 100,
      "forms": [
        {
           "op": ["observeproperty", "unobserveproperty"],
           "href": "properties/level",
           "subprotocol": "sse"
        }
      ]
    }
  }

When fixing this I'm tempted to remove the HTTP Basic Profile aspects from this example and make it only about the HTTP SSE Profile, because otherwise we also need to include readproperty and writeproperty in the op arrays. My original intention of including both profiles in the example was to show an example of a TD which used two profiles, but I think it would be less confusing to restrict the example to just the HTTP SSE Profile.