1
mirror of https://github.com/home-assistant/core synced 2024-09-28 03:04:04 +02:00

Use shorthand attributes in Laundrify (#99586)

This commit is contained in:
Joost Lekkerkerker 2023-09-04 13:15:02 +02:00 committed by GitHub
parent fa0b61e96a
commit 051e9e7498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,17 +51,14 @@ class LaundrifyPowerPlug(
"""Pass coordinator to CoordinatorEntity."""
super().__init__(coordinator)
self._device = device
self._attr_unique_id = device["_id"]
@property
def device_info(self) -> DeviceInfo:
"""Configure the Device of this Entity."""
return DeviceInfo(
identifiers={(DOMAIN, self._device["_id"])},
name=self._device["name"],
unique_id = device["_id"]
self._attr_unique_id = unique_id
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, unique_id)},
name=device["name"],
manufacturer=MANUFACTURER,
model=MODEL,
sw_version=self._device["firmwareVersion"],
sw_version=device["firmwareVersion"],
)
@property