[Tradfri] Added FLOALT panels #4366
[Tradfri] Added FLOALT panels #4366
Conversation
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Thanks, great to see support for the FLOALT devices. The behavior worries me a bit though: We will see the same for every new upcoming device that we do not yet specifically support. Shouldn't we make sure that we do not add additional discovery results? The recently introduced representation-property of things might probably help here. Would you want to have a look into that? |
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
I added the representation-property to the thing type definition. But I am not sure if this is the solution for the real problem (see comment in TradfriDiscoveryService#82). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I am not sure if this is the solution for the real problem (see comment in TradfriDiscoveryService#82).
Hm, this comments seems to be lost, at least I cannot see it when following this link...
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/config-description/v1.0.0 http://eclipse.org/smarthome/schemas/config-description-1.0.0.xsd"> | ||
|
||
<config-description uri="thing-type:tradfri:device"> | ||
<parameter-group name="device"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use parameter groups if there is just a single parameter to put into it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. I removed it.
</thing-type> | ||
|
||
<!-- note that this isn't yet supported by the code as we do not receive any data | ||
from the gateway for it --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is here a new line?
I am sorry. Maybe it got lost after a forced push: TradfriDiscoveryService.java#L82. |
Ok, you are right with the comment. If we do discovery while the bulb is unreachable, we will actually discover the wrong (or let's say a too simple) type. But the representation-property should nonetheless avoid that we see a new discovery result. So if the Thing has the wrong type, the user can delete it and re-discover it with the new type. |
Seems to work very well. I put a version similar to this PR - without the |
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Side note: All IKEA products got a common identifier in their name. I used this in #4271 to distinguish between color lights and spectrum lights.
Maybe this is a more future-safe approach to detect the type? |
COLOR_TEMP_MODELS
After you added a FLOALT panel to your environment it is correclty discovered as 0220 thing type. Once it becomes not reachable it is additionally discovered as 0100 thing type. This fix should prevent this behavior.
Signed-off-by: Christoph Weitkamp github@christophweitkamp.de