mirror of
https://github.com/home-assistant/core.git
synced 2025-04-30 12:17:52 +00:00
Use shorthand attributes in Juicenet (#99575)
This commit is contained in:
parent
890eed1121
commit
8ea3b877f6
@ -23,20 +23,12 @@ class JuiceNetDevice(CoordinatorEntity):
|
|||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self.device = device
|
self.device = device
|
||||||
self.key = key
|
self.key = key
|
||||||
|
self._attr_unique_id = f"{device.id}-{key}"
|
||||||
@property
|
self._attr_device_info = DeviceInfo(
|
||||||
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(
|
|
||||||
configuration_url=(
|
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",
|
manufacturer="JuiceNet",
|
||||||
name=self.device.name,
|
name=device.name,
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user