homieiot / convention

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

Clarify how $format works for integer and float datatypes #216

Closed qwandor closed 1 year ago

qwandor commented 3 years ago

The Homie 4.0.0 specification just says that $format "For integer and float: Describes a range of payloads e.g. 10:15".

It is not clear whether this is an open, closed or half-open range. In the example given, is 15 a valid value or not?

SvenDowideit commented 3 years ago

enum's could do with a little more specification - I've just come across https://github.com/euphi/ESP_Homie_WS2812FX/blob/026f0668003c0bddc1a8b7e35b9e282fe9e79939/src/WS2812Node.cpp#L46

where the author is trying to say numbers between 0 and 59 (inclusive, i think), and the strings next and prev

and they've also added spaces in front of next and prev

this $format causes https://flows.nodered.org/node/node-red-contrib-homie-convention to send the literal strings 0:59 and next (with a leading space)

Tieske commented 1 year ago

@SvenDowideit that's an error on behalf of the author of that code. He should have modelled the device differently.

@qwandor I just proposed an update in #233 that would also clarify this.