Pass the device name without mapping to the component#184
Pass the device name without mapping to the component#184balloob merged 6 commits intohome-assistant-libs:masterfrom syssi:feature/yeelight-ceiling4
Conversation
|
Is there a need to be so specific when matching for type? I think I would simply merge all those different versions into one, if there's no specific reason for that. Or more broadly, is it even necessary to have this type information available at all? |
|
The type will be important some day because every ceiling lamp has different features for example. But you are right... we shouldn't map the device type here. The full name should be passed to the component. |
|
This PR will change the entity id of discovered yeelights: We could introduce some legacy handling. Suggestions? |
| else: | ||
| logging.warning("Unknown miio device found: %s", entry) | ||
| device_type = \ | ||
| entry.name.replace(DEVICE_NAME_PREFIX, '').rsplit('_', 1)[0] |
There was a problem hiding this comment.
Why wouldn't we always do this? It seems unnecessary for us to make up our own device types instead of using the ones provided by Yeelink.
There was a problem hiding this comment.
The device_type is part of the entity id if the device is auto-discovered. The old mapping provides stable entity ids.
There was a problem hiding this comment.
Removing the previous mapping would be a breaking change for consistency.
There was a problem hiding this comment.
It will only be a breaking change if not resolved in Home Assistant. I think that it is weird that a discovery library is introducing their own names for types. We should follow the vendor types.
|
I've removed the mapping and will introduce it at Home Assistant. |
No description provided.