Skip to content

Commit 47946d0

Browse files
epenetCopilot
authored andcommitted
Add Tuya debug logging for new devices (home-assistant#150091)
Co-authored-by: Copilot <[email protected]>
1 parent d2586ca commit 47946d0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

homeassistant/components/tuya/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: TuyaConfigEntry) -> bool
153153
# Register known device IDs
154154
device_registry = dr.async_get(hass)
155155
for device in manager.device_map.values():
156+
LOGGER.debug(
157+
"Register device %s: %s (function: %s, status range: %s)",
158+
device.id,
159+
device.status,
160+
device.function,
161+
device.status_range,
162+
)
156163
device_registry.async_get_or_create(
157164
config_entry_id=entry.entry_id,
158165
identifiers={(DOMAIN, device.id)},
@@ -237,6 +244,14 @@ def add_device(self, device: CustomerDevice) -> None:
237244
# Ensure the device isn't present stale
238245
self.hass.add_job(self.async_remove_device, device.id)
239246

247+
LOGGER.debug(
248+
"Add device %s: %s (function: %s, status range: %s)",
249+
device.id,
250+
device.status,
251+
device.function,
252+
device.status_range,
253+
)
254+
240255
dispatcher_send(self.hass, TUYA_DISCOVERY_NEW, [device.id])
241256

242257
def remove_device(self, device_id: str) -> None:

0 commit comments

Comments
 (0)