Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Introduce the "retained" flag for properties to express "event"-like, stateless properties. Closes homieiot#70.
  • Loading branch information
David Gräff authored Oct 14, 2018
1 parent 28f7b14 commit 32b0032
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ 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 **stateful**.
A property is stateful by default. A stateless property would be useful for momentary events (door bell pressed). The MQTT retained flag will not be set on a stateless property.
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:

* **stateful + non-settable**: The node publishes a property state (temperature sensor)
* **stateful + settable**: The node publishes a property state, and can receive commands for the property (by controller or other party) (lamp power)
* **stateless + non-settable**: The node publishes momentary events (door bell pressed)
* **stateless + settable**: The node publishes momentary events, and can receive commands for the property (by controller or other party) (brew coffee)
* **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.
Expand Down Expand Up @@ -448,9 +448,9 @@ A property attribute MUST be one of these:
<td>No (<code>false</code>)</td>
</tr>
<tr>
<td>$stateful</td>
<td>$retained</td>
<td>Device → Controller</td>
<td>Specifies whether the property is stateful (<code>true</code>) or stateless (<code>false</code>). Publishing to a stateless property topic MUST always happen with the 'retain' flag off.</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>
Expand Down

0 comments on commit 32b0032

Please sign in to comment.