mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Use shorthand attributes in Ondilo ico (#99627)
This commit is contained in:
parent
3c82045289
commit
c6bdc380b6
@ -153,7 +153,13 @@ class OndiloICO(
|
|||||||
|
|
||||||
pooldata = self._pooldata()
|
pooldata = self._pooldata()
|
||||||
self._attr_unique_id = f"{pooldata['ICO']['serial_number']}-{description.key}"
|
self._attr_unique_id = f"{pooldata['ICO']['serial_number']}-{description.key}"
|
||||||
self._device_name = pooldata["name"]
|
self._attr_device_info = DeviceInfo(
|
||||||
|
identifiers={(DOMAIN, pooldata["ICO"]["serial_number"])},
|
||||||
|
manufacturer="Ondilo",
|
||||||
|
model="ICO",
|
||||||
|
name=pooldata["name"],
|
||||||
|
sw_version=pooldata["ICO"]["sw_version"],
|
||||||
|
)
|
||||||
|
|
||||||
def _pooldata(self):
|
def _pooldata(self):
|
||||||
"""Get pool data dict."""
|
"""Get pool data dict."""
|
||||||
@ -177,15 +183,3 @@ class OndiloICO(
|
|||||||
def native_value(self):
|
def native_value(self):
|
||||||
"""Last value of the sensor."""
|
"""Last value of the sensor."""
|
||||||
return self._devdata()["value"]
|
return self._devdata()["value"]
|
||||||
|
|
||||||
@property
|
|
||||||
def device_info(self) -> DeviceInfo:
|
|
||||||
"""Return the device info for the sensor."""
|
|
||||||
pooldata = self._pooldata()
|
|
||||||
return DeviceInfo(
|
|
||||||
identifiers={(DOMAIN, pooldata["ICO"]["serial_number"])},
|
|
||||||
manufacturer="Ondilo",
|
|
||||||
model="ICO",
|
|
||||||
name=self._device_name,
|
|
||||||
sw_version=pooldata["ICO"]["sw_version"],
|
|
||||||
)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user