homieiot / convention

🏡 The Homie Convention: a lightweight MQTT convention for the IoT
https://homieiot.github.io/
Other
705 stars 59 forks source link

add a 'format' for booleans #225

Closed Tieske closed 1 year ago

Tieske commented 2 years ago

currently I use a property named valve_open, as a boolean

If a format could be specified for boolean datatypes, like this:

It allows better description of state, whilst the internal representation remains a boolean. It would allow me to rename the property to just valve, and still be descriptive.

EDIT: reversed the order. since false is often represented as 0, and true as 1, so those values could be used as the index into the array that the values are.