From 436fcb7e85806ab56b3d0f78f4e06ecee4f0ac2a Mon Sep 17 00:00:00 2001 From: Matrix Date: Mon, 23 Jun 2025 19:14:18 +0800 Subject: [PATCH] Fixed YoLink incorrect valve status (#147021) * Fix valve status * Fix as suggested --- homeassistant/components/yolink/manifest.json | 2 +- homeassistant/components/yolink/valve.py | 5 ++++- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/yolink/manifest.json b/homeassistant/components/yolink/manifest.json index 74e2259f050..779b830637b 100644 --- a/homeassistant/components/yolink/manifest.json +++ b/homeassistant/components/yolink/manifest.json @@ -6,5 +6,5 @@ "dependencies": ["auth", "application_credentials"], "documentation": "https://www.home-assistant.io/integrations/yolink", "iot_class": "cloud_push", - "requirements": ["yolink-api==0.5.2"] + "requirements": ["yolink-api==0.5.5"] } diff --git a/homeassistant/components/yolink/valve.py b/homeassistant/components/yolink/valve.py index 0e8a5e61855..06dee8af540 100644 --- a/homeassistant/components/yolink/valve.py +++ b/homeassistant/components/yolink/valve.py @@ -155,7 +155,10 @@ class YoLinkValveEntity(YoLinkEntity, ValveEntity): @property def available(self) -> bool: """Return true is device is available.""" - if self.coordinator.dev_net_type is not None: + if ( + self.coordinator.device.is_support_mode_switching() + and self.coordinator.dev_net_type is not None + ): # When the device operates in Class A mode, it cannot be controlled. return self.coordinator.dev_net_type != ATTR_DEVICE_MODEL_A return super().available diff --git a/requirements_all.txt b/requirements_all.txt index 0c485b79a81..c6e8b8060c9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -3154,7 +3154,7 @@ yeelight==0.7.16 yeelightsunflower==0.0.10 # homeassistant.components.yolink -yolink-api==0.5.2 +yolink-api==0.5.5 # homeassistant.components.youless youless-api==2.2.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 51b55d206af..29addc25eff 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2598,7 +2598,7 @@ yalexs==8.10.0 yeelight==0.7.16 # homeassistant.components.yolink -yolink-api==0.5.2 +yolink-api==0.5.5 # homeassistant.components.youless youless-api==2.2.0