Closed Garfonso closed 2 years ago
I could not yet find any lamp devices that report its status via a second object.
KNX :(
I could not yet find any lamp devices that report its status via a second object.
KNX :(
Yes, KNX is true. I myself have KNX devices. But KNX adapter does not know anything about the devices, so can not apply any useful roles (in context of type detector), so KNX users depend on alias feature, anyway, today... :-/
A lot of the different light devices have an ON_ACTUAL / ACTUAL state that is for feedback from the lamp that the light is on (CT was missing this state, this PR will add it to CT, too, for sake of harmonization of light devices).
Currently, these ON_ACTUAL states are quite a mess... the biggest issue is, that the role
state
is allowed. This leads to a lot of miss detection, becausestate
is so generic. I see them in zigbee and also in shelly lights. They both have some states that match thereadOnly
criterion and have thestate
-role. This leads to issue in adapters that try to read the current state from those wrong detected states... :-/I could not yet find any lamp devices that report its status via a second object. I'd be happy to add testing for such devices. So I could not find out if they really use the role
state
for those objects. If so, I'd say that should be changed in the affected adapters.So, in this PR I disallow
state
for ON_ACTUAL, but allowstate.light
,switch.light
,sensor.light
andswitch
on all light devices.Additionally, to changing the regex for the ON_ACTUAL state, I also changed the default role. It was switch.light and state.light for different devices. Both are not good default roles,
switch
does not fit, because it is used to control things (i.e. mismatch for a read only state) andstate
is generic. For boolean read-only there is the categorysensor
and the dev docs already explicitly describesensor.light
as 'feedback from lamp, that it is ON' which is exactly what ON_ACTUAL / ACTUAL is for. So I changed default role tosensor.light
. But the new regex will still detect the old roles.