Fix ondilo_ico name attribute (#54290)

This commit is contained in:
Marc Mueller 2021-08-09 20:53:30 +02:00 committed by GitHub
parent 74d41ac5e5
commit 511af66b22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,9 +141,9 @@ class OndiloICO(CoordinatorEntity, SensorEntity):
self._poolid = self.coordinator.data[poolidx]["id"]
pooldata = self._pooldata()
self._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._name = f"{self._device_name} {description.name}"
self._attr_name = f"{self._device_name} {description.name}"
def _pooldata(self):
"""Get pool data dict."""
@ -168,11 +168,6 @@ class OndiloICO(CoordinatorEntity, SensorEntity):
"""Last value of the sensor."""
return self._devdata()["value"]
@property
def unique_id(self):
"""Return the unique ID of this entity."""
return self._unique_id
@property
def device_info(self):
"""Return the device info for the sensor."""