From 67e199fb2f0c7940903176501a9ca5a07f88507a Mon Sep 17 00:00:00 2001 From: David Knowles Date: Thu, 2 May 2024 01:56:27 -0400 Subject: [PATCH] Bump pydrawise to 2024.4.1 (#116449) * Bump pydrawise to 2024.4.1 * Fix typing errors * Use assert instead of cast * Remove unused import --- homeassistant/components/hydrawise/binary_sensor.py | 6 ++---- homeassistant/components/hydrawise/manifest.json | 2 +- homeassistant/components/hydrawise/switch.py | 3 ++- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/hydrawise/binary_sensor.py b/homeassistant/components/hydrawise/binary_sensor.py index a93976b12e0..b8c5dbddc7c 100644 --- a/homeassistant/components/hydrawise/binary_sensor.py +++ b/homeassistant/components/hydrawise/binary_sensor.py @@ -2,8 +2,6 @@ from __future__ import annotations -from pydrawise.schema import Zone - from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, BinarySensorEntity, @@ -65,5 +63,5 @@ class HydrawiseBinarySensor(HydrawiseEntity, BinarySensorEntity): if self.entity_description.key == "status": self._attr_is_on = self.coordinator.last_update_success elif self.entity_description.key == "is_watering": - zone: Zone = self.zone - self._attr_is_on = zone.scheduled_runs.current_run is not None + assert self.zone is not None + self._attr_is_on = self.zone.scheduled_runs.current_run is not None diff --git a/homeassistant/components/hydrawise/manifest.json b/homeassistant/components/hydrawise/manifest.json index 5181de7d2a4..8a0d52d550c 100644 --- a/homeassistant/components/hydrawise/manifest.json +++ b/homeassistant/components/hydrawise/manifest.json @@ -6,5 +6,5 @@ "documentation": "https://www.home-assistant.io/integrations/hydrawise", "iot_class": "cloud_polling", "loggers": ["pydrawise"], - "requirements": ["pydrawise==2024.3.0"] + "requirements": ["pydrawise==2024.4.1"] } diff --git a/homeassistant/components/hydrawise/switch.py b/homeassistant/components/hydrawise/switch.py index 2dc459e7dd4..bceaa85eb73 100644 --- a/homeassistant/components/hydrawise/switch.py +++ b/homeassistant/components/hydrawise/switch.py @@ -63,7 +63,8 @@ class HydrawiseSwitch(HydrawiseEntity, SwitchEntity): """Turn the device on.""" if self.entity_description.key == "manual_watering": await self.coordinator.api.start_zone( - self.zone, custom_run_duration=DEFAULT_WATERING_TIME.total_seconds() + self.zone, + custom_run_duration=int(DEFAULT_WATERING_TIME.total_seconds()), ) elif self.entity_description.key == "auto_watering": await self.coordinator.api.resume_zone(self.zone) diff --git a/requirements_all.txt b/requirements_all.txt index 5073f43e39d..bd6cfed0971 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1779,7 +1779,7 @@ pydiscovergy==3.0.0 pydoods==1.0.2 # homeassistant.components.hydrawise -pydrawise==2024.3.0 +pydrawise==2024.4.1 # homeassistant.components.android_ip_webcam pydroid-ipcam==2.0.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index e9589fe399e..2dc798b8d26 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1390,7 +1390,7 @@ pydexcom==0.2.3 pydiscovergy==3.0.0 # homeassistant.components.hydrawise -pydrawise==2024.3.0 +pydrawise==2024.4.1 # homeassistant.components.android_ip_webcam pydroid-ipcam==2.0.0