diff --git a/homeassistant/components/tuya/__init__.py b/homeassistant/components/tuya/__init__.py index fc408531a38..229c890cecb 100644 --- a/homeassistant/components/tuya/__init__.py +++ b/homeassistant/components/tuya/__init__.py @@ -227,21 +227,29 @@ class DeviceListener(SharingDeviceListener): self.hass = hass self.manager = manager - def update_device( - self, device: CustomerDevice, updated_status_properties: list[str] | None + # pylint disable can be removed when issue fixed in library + # https://github.com/tuya/tuya-device-sharing-sdk/pull/35 + def update_device( # pylint: disable=arguments-renamed + self, + device: CustomerDevice, + updated_status_properties: list[str] | None = None, + dp_timestamps: dict | None = None, ) -> None: - """Update device status.""" + """Update device status with optional DP timestamps.""" LOGGER.debug( - "Received update for device %s (online: %s): %s (updated properties: %s)", + "Received update for device %s (online: %s): %s" + " (updated properties: %s, dp_timestamps: %s)", device.id, device.online, device.status, updated_status_properties, + dp_timestamps, ) dispatcher_send( self.hass, f"{TUYA_HA_SIGNAL_UPDATE_ENTITY}_{device.id}", updated_status_properties, + dp_timestamps, ) def add_device(self, device: CustomerDevice) -> None: diff --git a/homeassistant/components/tuya/entity.py b/homeassistant/components/tuya/entity.py index 0ae0f793afd..7d51a006877 100644 --- a/homeassistant/components/tuya/entity.py +++ b/homeassistant/components/tuya/entity.py @@ -158,7 +158,9 @@ class TuyaEntity(Entity): ) async def _handle_state_update( - self, updated_status_properties: list[str] | None + self, + updated_status_properties: list[str] | None, + dp_timestamps: dict | None = None, ) -> None: self.async_write_ha_state() diff --git a/homeassistant/components/tuya/event.py b/homeassistant/components/tuya/event.py index 09ab8e8f544..0c07844ffba 100644 --- a/homeassistant/components/tuya/event.py +++ b/homeassistant/components/tuya/event.py @@ -134,7 +134,9 @@ class TuyaEventEntity(TuyaEntity, EventEntity): self._attr_event_types: list[str] = dpcode.range async def _handle_state_update( - self, updated_status_properties: list[str] | None + self, + updated_status_properties: list[str] | None, + dp_timestamps: dict | None = None, ) -> None: if ( updated_status_properties is None diff --git a/homeassistant/components/tuya/manifest.json b/homeassistant/components/tuya/manifest.json index 96ee50a38c9..b130cb4c0e2 100644 --- a/homeassistant/components/tuya/manifest.json +++ b/homeassistant/components/tuya/manifest.json @@ -43,5 +43,5 @@ "integration_type": "hub", "iot_class": "cloud_push", "loggers": ["tuya_iot"], - "requirements": ["tuya-device-sharing-sdk==0.2.1"] + "requirements": ["tuya-device-sharing-sdk==0.2.3"] } diff --git a/requirements_all.txt b/requirements_all.txt index d89119f0697..640002581be 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2991,7 +2991,7 @@ ttls==1.8.3 ttn_client==1.2.0 # homeassistant.components.tuya -tuya-device-sharing-sdk==0.2.1 +tuya-device-sharing-sdk==0.2.3 # homeassistant.components.twentemilieu twentemilieu==2.2.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 49e0337a036..841b840f236 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2465,7 +2465,7 @@ ttls==1.8.3 ttn_client==1.2.0 # homeassistant.components.tuya -tuya-device-sharing-sdk==0.2.1 +tuya-device-sharing-sdk==0.2.3 # homeassistant.components.twentemilieu twentemilieu==2.2.1