Migrate MyStrom to has entity name (#96540)
This commit is contained in:
parent
0ff8371953
commit
1ceb536dfb
2 changed files with 5 additions and 2 deletions
|
@ -70,10 +70,12 @@ async def async_setup_platform(
|
|||
class MyStromSwitch(SwitchEntity):
|
||||
"""Representation of a myStrom switch/plug."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
_attr_name = None
|
||||
|
||||
def __init__(self, plug, name):
|
||||
"""Initialize the myStrom switch/plug."""
|
||||
self.plug = plug
|
||||
self._attr_name = name
|
||||
self._attr_unique_id = self.plug.mac
|
||||
self._attr_device_info = DeviceInfo(
|
||||
identifiers={(DOMAIN, self.plug.mac)},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue