You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case you have a node property of type enumeration, but this enumeration has many elements, it can be useful to still use integer values for MQTT communication. However, also in these cases you want to announce the possible values with their meaning.
The current 3.0 convention allows to announce enumerations with their possible allowed values, but no mapping of integer values to a meaning.
As an example, in my ESP_Homie_WS2812FX Node there is a "mode" property that allows all modes from the WS2812FX lib. However, when setting a new mode, I still want to receive the new mode as integer, because it is much easier to parse.
So, for the announcement there should be a way to announce the mapping of the integer to it's corresponding mode name, e.g 46: Fire Flicker, 47: Fire Flicker (soft) etc.
What is your opinion about this?
Don't use integer, when you want something else, so send a string with the mode's name.
Lets extend the enum "format", so you can give each allowed enumeration value a description string.
Add a new dataype map that maps allowed integer values to a string.
The text was updated successfully, but these errors were encountered:
@timpur@ThomDietrich@Thalhammer Can we close this? A map structure is not easily possible via MQTT means and because we decided not to allow external data type standards, this issue is not solvable.
@euphi The convention is open for extension by the user, so if you feel like you need more topics in your application you're free to add them (as long as they don't conflict with any homie topics).
But as @davidgraeff already said, a map is not possible without quite complex parsing and tbh the approach you outlined above doesn't feel right anyway. @davidgraeff I think this can be closed.
In case you have a node property of type enumeration, but this enumeration has many elements, it can be useful to still use integer values for MQTT communication. However, also in these cases you want to announce the possible values with their meaning.
The current 3.0 convention allows to announce enumerations with their possible allowed values, but no mapping of integer values to a meaning.
As an example, in my ESP_Homie_WS2812FX Node there is a "mode" property that allows all modes from the WS2812FX lib. However, when setting a new mode, I still want to receive the new mode as integer, because it is much easier to parse.
So, for the announcement there should be a way to announce the mapping of the integer to it's corresponding mode name, e.g
46: Fire Flicker, 47: Fire Flicker (soft)
etc.What is your opinion about this?
map
that maps allowed integer values to a string.The text was updated successfully, but these errors were encountered: