From 5fadcc7acf95a9b2b760472806a04773c5f3f6d0 Mon Sep 17 00:00:00 2001 From: grm Date: Tue, 21 Dec 2021 21:39:11 +0100 Subject: [PATCH] Replace Entity.device_state_attributes with Entity.extra_state_attributes --- custom_components/gardena_smart_system/manifest.json | 2 +- custom_components/gardena_smart_system/sensor.py | 2 +- custom_components/gardena_smart_system/switch.py | 6 +++--- custom_components/gardena_smart_system/vacuum.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/custom_components/gardena_smart_system/manifest.json b/custom_components/gardena_smart_system/manifest.json index 1942d87..b4b35fc 100644 --- a/custom_components/gardena_smart_system/manifest.json +++ b/custom_components/gardena_smart_system/manifest.json @@ -1,7 +1,7 @@ { "domain": "gardena_smart_system", "name": "Gardena Smart System integration", - "version": "0.3", + "version": "0.2.5b4", "config_flow": true, "documentation": "https://github.com/py-smart-gardena/hass-gardena-smart-system", "issue_tracker": "https://github.com/py-smart-gardena/hass-gardena-smart-system/issues", diff --git a/custom_components/gardena_smart_system/sensor.py b/custom_components/gardena_smart_system/sensor.py index 70129c1..f8749d0 100644 --- a/custom_components/gardena_smart_system/sensor.py +++ b/custom_components/gardena_smart_system/sensor.py @@ -116,7 +116,7 @@ def state(self): return getattr(self._device, self._sensor_type) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the sensor.""" return { ATTR_BATTERY_LEVEL: self._device.battery_level, diff --git a/custom_components/gardena_smart_system/switch.py b/custom_components/gardena_smart_system/switch.py index a8c4caa..b9bf60a 100644 --- a/custom_components/gardena_smart_system/switch.py +++ b/custom_components/gardena_smart_system/switch.py @@ -119,7 +119,7 @@ def error(self): return self._error_message @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the water valve.""" return { ATTR_ACTIVITY: self._device.valve_activity, @@ -229,7 +229,7 @@ def error(self): return self._error_message @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the power switch.""" return { ATTR_ACTIVITY: self._device.activity, @@ -332,7 +332,7 @@ def error(self): return self._error_message @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the smart irrigation control.""" return { ATTR_ACTIVITY: self._device.valves[self._valve_id]["activity"], diff --git a/custom_components/gardena_smart_system/vacuum.py b/custom_components/gardena_smart_system/vacuum.py index 02a0c59..6484c75 100644 --- a/custom_components/gardena_smart_system/vacuum.py +++ b/custom_components/gardena_smart_system/vacuum.py @@ -149,7 +149,7 @@ def error(self): return "" @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes of the lawn mower.""" return { ATTR_ACTIVITY: self._device.activity,