Skip to content

Commit

Permalink
Stateful attribute for properties (#108)
Browse files Browse the repository at this point in the history
* Update README.md

Stateful attribute for properties

Signed-off: David Graeff <david.graeff@web.de>

* Update README.md

Introduce the "retained" flag for properties to express "event"-like, stateless properties. Closes #70.
  • Loading branch information
David Gräff authored and marvinroger committed Oct 27, 2018
1 parent 081214d commit 730357e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ The `lights` node might expose an `intensity` and a `color` property.
Properties can be **settable**.
For example, you don't want your `temperature` property to be settable in case of a temperature sensor (like the car example), but to be settable in case of a thermostat.

Properties can be **retained**.
A property is retained by default. A non-retained property would be useful for momentary events (door bell pressed).

A combination of those flags compiles into this list:

* **retained + non-settable**: The node publishes a property state (temperature sensor)
* **retained + settable**: The node publishes a property state, and can receive commands for the property (by controller or other party) (lamp power)
* **non-retained + non-settable**: The node publishes momentary events (door bell pressed)
* **non-retained + settable**: The node publishes momentary events, and can receive commands for the property (by controller or other party) (brew coffee)

**Attributes:**
*Devices, nodes and properties* have specific *attributes* characterizing them.
Attributes are represented by topic identifier starting with `$`.
Expand Down Expand Up @@ -437,6 +447,14 @@ A property attribute MUST be one of these:
<td>Yes</td>
<td>No (<code>false</code>)</td>
</tr>
<tr>
<td>$retained</td>
<td>DeviceController</td>
<td>Specifies whether the property is retained (<code>true</code>) or non-retained (<code>false</code>). Publishing to a non-retained property topic MUST always happen with the MQTT 'retain' flag off.</td>
<td><code>true</code> or <code>false</code></td>
<td>Yes</td>
<td>No (<code>true</code>)</td>
</tr>
<tr>
<td>$unit</td>
<td>DeviceController</td>
Expand Down

0 comments on commit 730357e

Please sign in to comment.