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 <jangwon.lee@lge.com>
This commit is contained in:
LG-ThinQ-Integration 2024-09-10 17:59:07 +09:00 committed by GitHub
parent 7eba111704
commit cb97085e48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import logging
from thinqconnect import DeviceType from thinqconnect import DeviceType
from thinqconnect.devices.const import Property as ThinQProperty from thinqconnect.devices.const import Property as ThinQProperty
from thinqconnect.integration import ActiveMode
from homeassistant.components.binary_sensor import ( from homeassistant.components.binary_sensor import (
BinarySensorEntity, BinarySensorEntity,
@ -91,7 +92,9 @@ async def async_setup_entry(
for description in descriptions: for description in descriptions:
entities.extend( entities.extend(
ThinQBinarySensorEntity(coordinator, description, property_id) 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: if entities:

View File

@ -7,6 +7,7 @@ from typing import Any
from thinqconnect import DeviceType from thinqconnect import DeviceType
from thinqconnect.devices.const import Property as ThinQProperty from thinqconnect.devices.const import Property as ThinQProperty
from thinqconnect.integration import ActiveMode
from homeassistant.components.switch import ( from homeassistant.components.switch import (
SwitchDeviceClass, SwitchDeviceClass,
@ -69,7 +70,9 @@ async def async_setup_entry(
for description in descriptions: for description in descriptions:
entities.extend( entities.extend(
ThinQSwitchEntity(coordinator, description, property_id) 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: if entities: