Open esdeboer opened 5 years ago
I don't think that manually editing the channels is the right way to go. If you define a range via $format, the code should generate a percentage value.
If not, that's a bug then that will get fixed :)
I've got this homie dimmer homie/crownstones/crownstone7/dimmer/$name Dimmer homie/crownstones/crownstone7/dimmer/$unit % homie/crownstones/crownstone7/dimmer/$datatype integer homie/crownstones/crownstone7/dimmer/$settable true homie/crownstones/crownstone7/dimmer/$format 0:100
this all gets set correctly in openHab 2.4, but as type number so I can't assign dimmer items to it.
I wonder if you can make an automatic distinction between number and dimmer based on the currently available input
If there's a range the binding should create a dimmer channel instead. I don't know if there's any scenario where you would like to have a number channel when a range is given.
Maybe if you want to display gauges, you would need to have a number and a range.
If it should create a percentage value, it looks like a bug, as Property.java looks like it always sets value to NumberValue for floats and integers in createChannelFromAttribute
Yup that need to be changed. I'd happily accept a patch if you want it done fast :)
Bonus would be another test case that checks if a min/max formatted homie property indeed creates a percentage value (so that this bug never appears again).
I haven't got time right now unfortunately.
I might take a look at it if I can get openhab to build/test correctly
It would be nice to be able to define the channel type for discovered homie things in paper ui.
At the moment you can't define percent value or rollershutter for homie integer data types, they will always be numbers. and I would like my dimmer to actually be a dimmer in Open Hab.