mirror of
https://github.com/home-assistant/core.git
synced 2025-09-10 15:21:38 +02:00
Add Tuya debug logging for new devices (#150091)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -153,6 +153,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: TuyaConfigEntry) -> bool
|
||||
# Register known device IDs
|
||||
device_registry = dr.async_get(hass)
|
||||
for device in manager.device_map.values():
|
||||
LOGGER.debug(
|
||||
"Register device %s: %s (function: %s, status range: %s)",
|
||||
device.id,
|
||||
device.status,
|
||||
device.function,
|
||||
device.status_range,
|
||||
)
|
||||
device_registry.async_get_or_create(
|
||||
config_entry_id=entry.entry_id,
|
||||
identifiers={(DOMAIN, device.id)},
|
||||
@@ -237,6 +244,14 @@ class DeviceListener(SharingDeviceListener):
|
||||
# Ensure the device isn't present stale
|
||||
self.hass.add_job(self.async_remove_device, device.id)
|
||||
|
||||
LOGGER.debug(
|
||||
"Add device %s: %s (function: %s, status range: %s)",
|
||||
device.id,
|
||||
device.status,
|
||||
device.function,
|
||||
device.status_range,
|
||||
)
|
||||
|
||||
dispatcher_send(self.hass, TUYA_DISCOVERY_NEW, [device.id])
|
||||
|
||||
def remove_device(self, device_id: str) -> None:
|
||||
|
Reference in New Issue
Block a user