Update tuya-device-sharing-sdk to version 0.2.1 (#130333)

This commit is contained in:
Markus Lanthaler
2024-11-11 20:40:37 +01:00
committed by GitHub
parent e97a5f927c
commit 96c12fdd10
5 changed files with 19 additions and 7 deletions

View File

@ -146,14 +146,21 @@ class DeviceListener(SharingDeviceListener):
self.hass = hass
self.manager = manager
def update_device(self, device: CustomerDevice) -> None:
def update_device(
self, device: CustomerDevice, updated_status_properties: list[str] | None
) -> None:
"""Update device status."""
LOGGER.debug(
"Received update for device %s: %s",
"Received update for device %s: %s (updated properties: %s)",
device.id,
self.manager.device_map[device.id].status,
updated_status_properties,
)
dispatcher_send(
self.hass,
f"{TUYA_HA_SIGNAL_UPDATE_ENTITY}_{device.id}",
updated_status_properties,
)
dispatcher_send(self.hass, f"{TUYA_HA_SIGNAL_UPDATE_ENTITY}_{device.id}")
def add_device(self, device: CustomerDevice) -> None:
"""Add device added listener."""

View File

@ -283,10 +283,15 @@ class TuyaEntity(Entity):
async_dispatcher_connect(
self.hass,
f"{TUYA_HA_SIGNAL_UPDATE_ENTITY}_{self.device.id}",
self.async_write_ha_state,
self._handle_state_update,
)
)
async def _handle_state_update(
self, updated_status_properties: list[str] | None
) -> None:
self.async_write_ha_state()
def _send_command(self, commands: list[dict[str, Any]]) -> None:
"""Send command to the device."""
LOGGER.debug("Sending commands for device %s: %s", self.device.id, commands)

View File

@ -43,5 +43,5 @@
"integration_type": "hub",
"iot_class": "cloud_push",
"loggers": ["tuya_iot"],
"requirements": ["tuya-device-sharing-sdk==0.1.9"]
"requirements": ["tuya-device-sharing-sdk==0.2.1"]
}

View File

@ -2873,7 +2873,7 @@ ttls==1.8.3
ttn_client==1.2.0
# homeassistant.components.tuya
tuya-device-sharing-sdk==0.1.9
tuya-device-sharing-sdk==0.2.1
# homeassistant.components.twentemilieu
twentemilieu==2.0.1

View File

@ -2286,7 +2286,7 @@ ttls==1.8.3
ttn_client==1.2.0
# homeassistant.components.tuya
tuya-device-sharing-sdk==0.1.9
tuya-device-sharing-sdk==0.2.1
# homeassistant.components.twentemilieu
twentemilieu==2.0.1