diff --git a/custom_components/raincloud/__init__.py b/custom_components/raincloud/__init__.py index 168ef0c..833faed 100644 --- a/custom_components/raincloud/__init__.py +++ b/custom_components/raincloud/__init__.py @@ -118,7 +118,6 @@ def setup(hass, config): ) return False - def handle_rain_delay(call): """Set the rain delay for all valves""" @@ -133,7 +132,7 @@ def handle_rain_delay(call): dispatcher_send(hass, SIGNAL_UPDATE_RAINCLOUD) return True - + hass.services.register(DOMAIN, RAIN_DELAY_SERVICE_ATTR, handle_rain_delay) def hub_refresh(event_time): @@ -205,11 +204,11 @@ def unit_of_measurement(self): return UNIT_OF_MEASUREMENT_MAP.get(self._sensor_type) @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return {ATTR_ATTRIBUTION: ATTRIBUTION, "identifier": self.data.serial} @property def icon(self): """Return the icon to use in the frontend, if any.""" - return ICON_MAP.get(self._sensor_type) \ No newline at end of file + return ICON_MAP.get(self._sensor_type) diff --git a/custom_components/raincloud/manifest.json b/custom_components/raincloud/manifest.json index 6ab622f..07d2504 100644 --- a/custom_components/raincloud/manifest.json +++ b/custom_components/raincloud/manifest.json @@ -1,7 +1,7 @@ { "domain": "raincloud", "name": "Melnor RainCloud", - "version": "1.2.3", + "version": "1.2.4", "documentation": "https://github.com/vanstinator/hass-raincloud/blob/master/README.md", "requirements": ["raincloudy==1.1.1"], "codeowners": ["@vanstinator"], diff --git a/custom_components/raincloud/switch.py b/custom_components/raincloud/switch.py index 3739ed5..e4dbecd 100644 --- a/custom_components/raincloud/switch.py +++ b/custom_components/raincloud/switch.py @@ -42,7 +42,8 @@ def setup_platform(hass, config, add_entities, discovery_info=None): for controller in raincloud.controllers: for faucet in controller.faucets: for zone in faucet.zones: - sensors.append(RainCloudSwitch(default_watering_timer, zone, sensor_type)) + sensors.append(RainCloudSwitch( + default_watering_timer, zone, sensor_type)) add_entities(sensors, True) @@ -85,10 +86,10 @@ def update(self): self._state = self.data.auto_watering @property - def device_state_attributes(self): + def extra_state_attributes(self): """Return the state attributes.""" return { ATTR_ATTRIBUTION: ATTRIBUTION, "default_manual_timer": self._default_watering_timer, "identifier": self.data.serial, - } \ No newline at end of file + } diff --git a/hacs.json b/hacs.json index b52ec5d..c74acbd 100644 --- a/hacs.json +++ b/hacs.json @@ -2,7 +2,7 @@ "name": "Melnor Raincloud", "render_readme": true, "domains": ["binary_sensor", "sensor", "switch"], - "homeassistant": "0.115.0", + "homeassistant": "2021.4.0", "zip_release": true, "filename": "raincloud.zip", "iot_class": "cloud_polling"