Migrate Home plus control to has entity name (#96596)
parent
8d048c4cfa
commit
9b29cbd71c
|
@ -66,17 +66,15 @@ class HomeControlSwitchEntity(CoordinatorEntity, SwitchEntity):
|
|||
consumption methods and state attributes.
|
||||
"""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
_attr_name = None
|
||||
|
||||
def __init__(self, coordinator, idx):
|
||||
"""Pass coordinator to CoordinatorEntity."""
|
||||
super().__init__(coordinator)
|
||||
self.idx = idx
|
||||
self.module = self.coordinator.data[self.idx]
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Name of the device."""
|
||||
return self.module.name
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
"""ID (unique) of the device."""
|
||||
|
@ -92,7 +90,7 @@ class HomeControlSwitchEntity(CoordinatorEntity, SwitchEntity):
|
|||
},
|
||||
manufacturer="Legrand",
|
||||
model=HW_TYPE.get(self.module.hw_type),
|
||||
name=self.name,
|
||||
name=self.module.name,
|
||||
sw_version=self.module.fw,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue