Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
azerty9971 committed Jan 26, 2025
1 parent 86073d4 commit 051c7e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/xtend_tuya/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Support for Tuya Smart devices."""

from __future__ import absolute_import
from __future__ import annotations
import logging

import time
import time as py_time

from homeassistant.config_entries import ConfigEntry, ConfigEntryState
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -90,10 +90,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: XTConfigEntry) -> bool:
async def cleanup_device_registry(hass: HomeAssistant, multi_manager: MultiManager, current_entry: ConfigEntry) -> None:
"""Remove deleted device registry entry if there are no remaining entities."""
while not are_all_domain_config_loaded(hass, DOMAIN_ORIG, None):
time.sleep(1)
py_time.sleep(1)
while not are_all_domain_config_loaded(hass, DOMAIN, current_entry):
if is_config_entry_master(hass, DOMAIN, current_entry):
time.sleep(1)
py_time.sleep(1)
else:
return
device_registry = dr.async_get(hass)
Expand Down

0 comments on commit 051c7e1

Please sign in to comment.