Use shorthand attributes in Laundrify (#99586)
This commit is contained in:
parent
fa0b61e96a
commit
051e9e7498
1 changed files with 6 additions and 9 deletions
|
@ -51,17 +51,14 @@ class LaundrifyPowerPlug(
|
||||||
"""Pass coordinator to CoordinatorEntity."""
|
"""Pass coordinator to CoordinatorEntity."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self._device = device
|
self._device = device
|
||||||
self._attr_unique_id = device["_id"]
|
unique_id = device["_id"]
|
||||||
|
self._attr_unique_id = unique_id
|
||||||
@property
|
self._attr_device_info = DeviceInfo(
|
||||||
def device_info(self) -> DeviceInfo:
|
identifiers={(DOMAIN, unique_id)},
|
||||||
"""Configure the Device of this Entity."""
|
name=device["name"],
|
||||||
return DeviceInfo(
|
|
||||||
identifiers={(DOMAIN, self._device["_id"])},
|
|
||||||
name=self._device["name"],
|
|
||||||
manufacturer=MANUFACTURER,
|
manufacturer=MANUFACTURER,
|
||||||
model=MODEL,
|
model=MODEL,
|
||||||
sw_version=self._device["firmwareVersion"],
|
sw_version=device["firmwareVersion"],
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Add table
Reference in a new issue