From 051e9e7498b7f1d702a78c7a5321b2d828d290d0 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Mon, 4 Sep 2023 13:15:02 +0200 Subject: [PATCH] Use shorthand attributes in Laundrify (#99586) --- .../components/laundrify/binary_sensor.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/laundrify/binary_sensor.py b/homeassistant/components/laundrify/binary_sensor.py index 81882b68f006..5cca6870b6c0 100644 --- a/homeassistant/components/laundrify/binary_sensor.py +++ b/homeassistant/components/laundrify/binary_sensor.py @@ -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