Add unique id's to Vallox entities (#58459)
* Add unique id's to Vallox entities * Cache uuid properties Requested in code review. Caching None isn't a problem as the underlying implementation of get_uuid in the vallox_websocket_api library can never return None. * Simplify get_uuid type check Based on review comments. * Set _attr_unique_id in init * Import the library get_uuid under a different name There are a few options here: 1. Rename the get_uuid method with a synonym 2. Import get_uuid under a different name 3. Convert get_uuid into a property 4. Rename get_uuid in the Vallox library None of these options is that appealing. I'll start with option two, anyways.
This commit is contained in:
parent
a4208c0926
commit
5cc594682f
3 changed files with 14 additions and 0 deletions
|
@ -99,6 +99,8 @@ class ValloxFan(CoordinatorEntity, FanEntity):
|
|||
|
||||
self._attr_name = name
|
||||
|
||||
self._attr_unique_id = str(self.coordinator.data.get_uuid())
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Flag supported features."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue