From 7e882f9fc237ff1451631d24b18cbad40abd460d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=92=B8=E9=B1=BC=E8=80=8C=E5=B7=B2?= <64669899+hvvvvvvv@users.noreply.github.com> Date: Sat, 13 Jul 2024 02:28:25 +0800 Subject: [PATCH 1/2] Update __init__.py Fix the issue where the custom entity attribute "interval_seconds" is not taking effect. --- custom_components/xiaomi_miot/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/xiaomi_miot/__init__.py b/custom_components/xiaomi_miot/__init__.py index 08ddcf0fc..3df41dd8d 100644 --- a/custom_components/xiaomi_miot/__init__.py +++ b/custom_components/xiaomi_miot/__init__.py @@ -841,6 +841,8 @@ def update_custom_scan_interval(self, only_custom=False): tim = timedelta(seconds=sec) if sec > 0 and tim != self.platform.scan_interval: self.platform.scan_interval = tim + if(hasattr(self.platform, "scan_interval_seconds")): + self.platform.scan_interval_seconds = tim.total_seconds() _LOGGER.debug('%s: Update custom scan interval: %s', self.name_model, tim) def update_custom_parallel_updates(self): From 441c11ad6940716d89ca49f1366a4dadcc4e5c43 Mon Sep 17 00:00:00 2001 From: Alone Date: Sun, 14 Jul 2024 13:33:33 +0800 Subject: [PATCH 2/2] Update __init__.py --- custom_components/xiaomi_miot/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/xiaomi_miot/__init__.py b/custom_components/xiaomi_miot/__init__.py index 3df41dd8d..1964812e9 100644 --- a/custom_components/xiaomi_miot/__init__.py +++ b/custom_components/xiaomi_miot/__init__.py @@ -841,7 +841,7 @@ def update_custom_scan_interval(self, only_custom=False): tim = timedelta(seconds=sec) if sec > 0 and tim != self.platform.scan_interval: self.platform.scan_interval = tim - if(hasattr(self.platform, "scan_interval_seconds")): + if hasattr(self.platform, 'scan_interval_seconds'): self.platform.scan_interval_seconds = tim.total_seconds() _LOGGER.debug('%s: Update custom scan interval: %s', self.name_model, tim)