mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Update tuya-device-sharing-sdk to version 0.2.1 (#130333)
This commit is contained in:
parent
e97a5f927c
commit
96c12fdd10
@ -146,14 +146,21 @@ class DeviceListener(SharingDeviceListener):
|
|||||||
self.hass = hass
|
self.hass = hass
|
||||||
self.manager = manager
|
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."""
|
"""Update device status."""
|
||||||
LOGGER.debug(
|
LOGGER.debug(
|
||||||
"Received update for device %s: %s",
|
"Received update for device %s: %s (updated properties: %s)",
|
||||||
device.id,
|
device.id,
|
||||||
self.manager.device_map[device.id].status,
|
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:
|
def add_device(self, device: CustomerDevice) -> None:
|
||||||
"""Add device added listener."""
|
"""Add device added listener."""
|
||||||
|
@ -283,10 +283,15 @@ class TuyaEntity(Entity):
|
|||||||
async_dispatcher_connect(
|
async_dispatcher_connect(
|
||||||
self.hass,
|
self.hass,
|
||||||
f"{TUYA_HA_SIGNAL_UPDATE_ENTITY}_{self.device.id}",
|
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:
|
def _send_command(self, commands: list[dict[str, Any]]) -> None:
|
||||||
"""Send command to the device."""
|
"""Send command to the device."""
|
||||||
LOGGER.debug("Sending commands for device %s: %s", self.device.id, commands)
|
LOGGER.debug("Sending commands for device %s: %s", self.device.id, commands)
|
||||||
|
@ -43,5 +43,5 @@
|
|||||||
"integration_type": "hub",
|
"integration_type": "hub",
|
||||||
"iot_class": "cloud_push",
|
"iot_class": "cloud_push",
|
||||||
"loggers": ["tuya_iot"],
|
"loggers": ["tuya_iot"],
|
||||||
"requirements": ["tuya-device-sharing-sdk==0.1.9"]
|
"requirements": ["tuya-device-sharing-sdk==0.2.1"]
|
||||||
}
|
}
|
||||||
|
@ -2873,7 +2873,7 @@ ttls==1.8.3
|
|||||||
ttn_client==1.2.0
|
ttn_client==1.2.0
|
||||||
|
|
||||||
# homeassistant.components.tuya
|
# homeassistant.components.tuya
|
||||||
tuya-device-sharing-sdk==0.1.9
|
tuya-device-sharing-sdk==0.2.1
|
||||||
|
|
||||||
# homeassistant.components.twentemilieu
|
# homeassistant.components.twentemilieu
|
||||||
twentemilieu==2.0.1
|
twentemilieu==2.0.1
|
||||||
|
@ -2286,7 +2286,7 @@ ttls==1.8.3
|
|||||||
ttn_client==1.2.0
|
ttn_client==1.2.0
|
||||||
|
|
||||||
# homeassistant.components.tuya
|
# homeassistant.components.tuya
|
||||||
tuya-device-sharing-sdk==0.1.9
|
tuya-device-sharing-sdk==0.2.1
|
||||||
|
|
||||||
# homeassistant.components.twentemilieu
|
# homeassistant.components.twentemilieu
|
||||||
twentemilieu==2.0.1
|
twentemilieu==2.0.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user