Update integrations p-s to override extra_state_attributes() (#47759)

This commit is contained in:
Erik Montnemery 2021-03-11 21:23:20 +01:00 committed by GitHub
parent 1fc8e32d86
commit 14ff6d4d1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
106 changed files with 144 additions and 146 deletions

View file

@ -268,7 +268,7 @@ class QNAPMemorySensor(QNAPSensor):
return round(used / total * 100)
@property
def device_state_attributes(self):
def extra_state_attributes(self):
"""Return the state attributes."""
if self._api.data:
data = self._api.data["system_stats"]["memory"]
@ -294,7 +294,7 @@ class QNAPNetworkSensor(QNAPSensor):
return round_nicely(data["rx"] / 1024 / 1024)
@property
def device_state_attributes(self):
def extra_state_attributes(self):
"""Return the state attributes."""
if self._api.data:
data = self._api.data["system_stats"]["nics"][self.monitor_device]
@ -322,7 +322,7 @@ class QNAPSystemSensor(QNAPSensor):
return int(self._api.data["system_stats"]["system"]["temp_c"])
@property
def device_state_attributes(self):
def extra_state_attributes(self):
"""Return the state attributes."""
if self._api.data:
data = self._api.data["system_stats"]
@ -360,7 +360,7 @@ class QNAPDriveSensor(QNAPSensor):
return f"{server_name} {self.var_name} (Drive {self.monitor_device})"
@property
def device_state_attributes(self):
def extra_state_attributes(self):
"""Return the state attributes."""
if self._api.data:
data = self._api.data["smart_drive_health"][self.monitor_device]
@ -394,7 +394,7 @@ class QNAPVolumeSensor(QNAPSensor):
return round(used_gb / total_gb * 100)
@property
def device_state_attributes(self):
def extra_state_attributes(self):
"""Return the state attributes."""
if self._api.data:
data = self._api.data["volumes"][self.monitor_device]