diff --git a/custom_components/xiaomi_miot/__init__.py b/custom_components/xiaomi_miot/__init__.py index fb0473c5d..1f86f7b2d 100644 --- a/custom_components/xiaomi_miot/__init__.py +++ b/custom_components/xiaomi_miot/__init__.py @@ -590,7 +590,7 @@ async def updated(event: hass_core.Event): if device.disabled and miot_device.coordinators: await miot_device.async_unload() if not device.disabled and not miot_device.coordinators: - miot_device.init_converters() + await miot_device.init_coordinators() hass.bus.async_listen(dr.EVENT_DEVICE_REGISTRY_UPDATED, updated) diff --git a/custom_components/xiaomi_miot/core/device.py b/custom_components/xiaomi_miot/core/device.py index 6de59701c..df49deffc 100644 --- a/custom_components/xiaomi_miot/core/device.py +++ b/custom_components/xiaomi_miot/core/device.py @@ -356,9 +356,6 @@ def init_converters(self): if not self.spec: return - if dby := self.hass_device_disabled: - self.log.debug('Device disabled by: %s', dby) - return for cfg in GLOBAL_CONVERTERS: cls = cfg.get('class') @@ -453,6 +450,10 @@ def init_converters(self): self.add_converter(AttrConv(attr, d)) async def init_coordinators(self): + if dby := self.hass_device_disabled: + self.log.debug('Device disabled by: %s', dby) + return + interval = 30 interval = self.entry.get_config('scan_interval') or interval interval = self.custom_config_integer('interval_seconds') or interval