From 8ea3b877f651fc5dc207cda4b56320043d7ef48c Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Mon, 4 Sep 2023 13:21:30 +0200 Subject: [PATCH] Use shorthand attributes in Juicenet (#99575) --- homeassistant/components/juicenet/entity.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/homeassistant/components/juicenet/entity.py b/homeassistant/components/juicenet/entity.py index 3c325715c82..b3433948582 100644 --- a/homeassistant/components/juicenet/entity.py +++ b/homeassistant/components/juicenet/entity.py @@ -23,20 +23,12 @@ class JuiceNetDevice(CoordinatorEntity): super().__init__(coordinator) self.device = device self.key = key - - @property - def unique_id(self): - """Return a unique ID.""" - return f"{self.device.id}-{self.key}" - - @property - def device_info(self) -> DeviceInfo: - """Return device information about this JuiceNet Device.""" - return DeviceInfo( + self._attr_unique_id = f"{device.id}-{key}" + self._attr_device_info = DeviceInfo( configuration_url=( - f"https://home.juice.net/Portal/Details?unitID={self.device.id}" + f"https://home.juice.net/Portal/Details?unitID={device.id}" ), - identifiers={(DOMAIN, self.device.id)}, + identifiers={(DOMAIN, device.id)}, manufacturer="JuiceNet", - name=self.device.name, + name=device.name, )