Fixed YoLink incorrect valve status (#147021)

* Fix valve status

* Fix as suggested
This commit is contained in:
Matrix
2025-06-23 19:14:18 +08:00
committed by GitHub
parent 4d2f0f2de6
commit 436fcb7e85
4 changed files with 7 additions and 4 deletions

View File

@ -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"]
}

View File

@ -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

2
requirements_all.txt generated
View File

@ -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

View File

@ -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