WebThingsIO / schemas

A Web of Things schema repository
https://webthings.io/schemas/
5 stars 8 forks source link

PushButton Capability Schema #8

Closed benfrancis closed 6 years ago

benfrancis commented 6 years ago

As a device developer I want to tell a Web of Things client that my device acts as a push button.

Example Thing Description:

{
  "@context": "https://iot.mozilla.org/schemas",
  "@type": ["PushButton"],
  "name": "Push Button",
  "properties": {
    "pushed": {
      "@type": "PushedProperty",
      "type": "boolean"
    }
  }
}
rzr commented 6 years ago

does this replace the switch ? because In my world a button stay in original position if not pressed (due to spring) ?

I also implemented a toggle button, that toggle its "internal state" on each press action.

rzr commented 6 years ago

Ok we're aligned

https://github.com/mozilla-iot/schemas/pull/7

A momenetary switch which can be pressed and returns to an un-pressed state when released.