From 04c9d55e0343b70d7e841d7830a5693762f01210 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 1 Oct 2025 10:13:59 +0000 Subject: [PATCH] Add quirk for g1cp07dsqnbdbbki --- homeassistant/components/tuya/quirks/__init__.py | 16 ++++++++++++++++ .../tuya/fixtures/cl_g1cp07dsqnbdbbki.json | 2 +- tests/components/tuya/snapshots/test_cover.ambr | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/tuya/quirks/__init__.py b/homeassistant/components/tuya/quirks/__init__.py index 07c012c76caa..c49a61ac94a5 100644 --- a/homeassistant/components/tuya/quirks/__init__.py +++ b/homeassistant/components/tuya/quirks/__init__.py @@ -16,6 +16,22 @@ __all__ = [ TUYA_QUIRKS_REGISTRY = QuirksRegistry() +( + # This model has percent_state and percent_control but percent_state never + # gets updated - force percent_control instead + DeviceQuirk() + .applies_to(category="cl", product_id="g1cp07dsqnbdbbki") + .add_cover( + key="control", + translation_key="curtain", + translation_string="curtain", + current_state_dp_code="control", + current_position_dp_code="percent_control", + set_position_dp_code="percent_control", + device_class=TuyaCoverDeviceClass.CURTAIN, + ) + .register(TUYA_QUIRKS_REGISTRY) +) ( # This model has percent_control / percent_state / situation_set # but they never get updated - use control instead to get the state diff --git a/tests/components/tuya/fixtures/cl_g1cp07dsqnbdbbki.json b/tests/components/tuya/fixtures/cl_g1cp07dsqnbdbbki.json index 85f4ec91d4b2..a709215e4c3f 100644 --- a/tests/components/tuya/fixtures/cl_g1cp07dsqnbdbbki.json +++ b/tests/components/tuya/fixtures/cl_g1cp07dsqnbdbbki.json @@ -93,7 +93,7 @@ "control": "open", "work_state": "opening", "percent_state": 0, - "percent_control": 100, + "percent_control": 62, "control_back_mode": "back", "border": "up" }, diff --git a/tests/components/tuya/snapshots/test_cover.ambr b/tests/components/tuya/snapshots/test_cover.ambr index 8bf58627819f..8cf5db5080e6 100644 --- a/tests/components/tuya/snapshots/test_cover.ambr +++ b/tests/components/tuya/snapshots/test_cover.ambr @@ -493,7 +493,7 @@ # name: test_platform_setup_and_discovery[cover.persiana_do_quarto_curtain-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'current_position': 100, + 'current_position': 38, 'device_class': 'curtain', 'friendly_name': 'Persiana do Quarto Curtain', 'supported_features': ,