From cb97085e48139c77fa6b70ea509aee2271233075 Mon Sep 17 00:00:00 2001 From: LG-ThinQ-Integration Date: Tue, 10 Sep 2024 17:59:07 +0900 Subject: [PATCH] Create property_ids with ActiveMode in LG ThinQ integration (#125638) * Bump thinqconnect to 0.9.7 * Pass a r/w parameter to get active properties id from the cloud --------- Co-authored-by: jangwon.lee --- homeassistant/components/lg_thinq/binary_sensor.py | 5 ++++- homeassistant/components/lg_thinq/switch.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/lg_thinq/binary_sensor.py b/homeassistant/components/lg_thinq/binary_sensor.py index 6f856c3055f..c3179ea6948 100644 --- a/homeassistant/components/lg_thinq/binary_sensor.py +++ b/homeassistant/components/lg_thinq/binary_sensor.py @@ -6,6 +6,7 @@ import logging from thinqconnect import DeviceType from thinqconnect.devices.const import Property as ThinQProperty +from thinqconnect.integration import ActiveMode from homeassistant.components.binary_sensor import ( BinarySensorEntity, @@ -91,7 +92,9 @@ async def async_setup_entry( for description in descriptions: entities.extend( ThinQBinarySensorEntity(coordinator, description, property_id) - for property_id in coordinator.api.get_active_idx(description.key) + for property_id in coordinator.api.get_active_idx( + description.key, ActiveMode.READ_ONLY + ) ) if entities: diff --git a/homeassistant/components/lg_thinq/switch.py b/homeassistant/components/lg_thinq/switch.py index ef85c8ad50e..fe78b7813fa 100644 --- a/homeassistant/components/lg_thinq/switch.py +++ b/homeassistant/components/lg_thinq/switch.py @@ -7,6 +7,7 @@ from typing import Any from thinqconnect import DeviceType from thinqconnect.devices.const import Property as ThinQProperty +from thinqconnect.integration import ActiveMode from homeassistant.components.switch import ( SwitchDeviceClass, @@ -69,7 +70,9 @@ async def async_setup_entry( for description in descriptions: entities.extend( ThinQSwitchEntity(coordinator, description, property_id) - for property_id in coordinator.api.get_active_idx(description.key) + for property_id in coordinator.api.get_active_idx( + description.key, ActiveMode.READ_WRITE + ) ) if entities: