From 41a9d68fa2c9393adb69ee10e5bc62eacc071780 Mon Sep 17 00:00:00 2001 From: Alone Date: Sat, 28 Dec 2024 20:58:27 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20improve=20for=20update=20status?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/xiaomi_miot/core/device.py | 2 +- .../xiaomi_miot/core/device_customizes.py | 41 +++++++++++++------ 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/custom_components/xiaomi_miot/core/device.py b/custom_components/xiaomi_miot/core/device.py index a186ccbae..644587571 100644 --- a/custom_components/xiaomi_miot/core/device.py +++ b/custom_components/xiaomi_miot/core/device.py @@ -471,7 +471,7 @@ async def init_coordinators(self): self.log.debug('Device disabled by: %s', dby) return - interval = 30 + interval = 60 interval = self.entry.get_config('scan_interval') or interval interval = self.custom_config_integer('interval_seconds') or interval lst = await self.init_miot_coordinators(interval) diff --git a/custom_components/xiaomi_miot/core/device_customizes.py b/custom_components/xiaomi_miot/core/device_customizes.py index 569267878..7a41698f1 100644 --- a/custom_components/xiaomi_miot/core/device_customizes.py +++ b/custom_components/xiaomi_miot/core/device_customizes.py @@ -91,7 +91,6 @@ 'device_class': 'occupancy', }, 'ainice.sensor_occupy.bt': { - 'interval_seconds': 60, 'parallel_updates': 1, 'switch_properties': 'indicator_switch,bt_pair_switch', 'select_properties': 'bt_power_level', @@ -442,7 +441,6 @@ 'cuco.plug.wp12:power_cost_today': {'value_ratio': 1}, 'cuco.plug.wp12:power_cost_month': {'value_ratio': 1}, 'cuco.plug.*': { - 'interval_seconds': 60, 'parallel_updates': 3, }, 'cuco.plug.*:electric_current': { @@ -534,7 +532,6 @@ 'switch_properties': 'fast_update_switch', }, 'devcea.light.ls2307': { - 'interval_seconds': 60, 'exclude_miot_properties': 'update,colorful_set', 'switch_properties': 'flex_switch,ac_status,power_on_state,custom_sleep_aid,custom_weak_up', 'select_properties': 'ambient_light.mode', @@ -929,7 +926,6 @@ }, 'lumi.acpartner.mcn04': { 'auto_cloud': True, - 'interval_seconds': 60, 'chunk_properties': 8, 'sensor_properties': 'electric_power', 'switch_properties': 'on,quick_cool_enable,indicator_light', @@ -2151,11 +2147,10 @@ 'number_properties': 'target_humidity', 'fan_services': 'air_fresh', 'chunk_coordinators': [ - {'interval': 10, 'props': 'on,mode,target_temperature,fan_level'}, + {'interval': 10, 'props': 'on,mode,target_temperature,fan_level', 'notify': True}, ], }, '*.airer.*': { - 'interval_seconds': 60, 'position_reverse': True, 'sensor_properties': 'left_time', 'switch_properties': 'dryer,uv', @@ -2164,10 +2159,10 @@ {'interval': 15, 'props': 'status,current_position,target_position,dryer,drying_level'}, ], }, - '*.airrtc.*': { - 'switch_properties': 'air_conditioner.on', + '*.airfresh.*': { 'chunk_coordinators': [ - {'interval': 10, 'props': 'on,mode,target_temperature,fan_level'}, + {'interval': 10, 'props': 'on,mode,fan_level'}, + {'interval': 300, 'props': 'filter_life_level,filter_left_time,filter_used_time'}, ], }, '*.airpurifier.*': { @@ -2175,6 +2170,13 @@ 'sensor_properties': 'relative_humidity,pm2_5_density,temperature,filter_life_level', 'chunk_coordinators': [ {'interval': 10, 'props': 'on,mode,fan_level'}, + {'interval': 300, 'props': 'filter_life_level,filter_left_time,filter_used_time'}, + ], + }, + '*.airrtc.*': { + 'switch_properties': 'air_conditioner.on', + 'chunk_coordinators': [ + {'interval': 10, 'props': 'on,mode,target_temperature,fan_level', 'notify': True}, ], }, '*.bhf_light.*': { @@ -2217,7 +2219,6 @@ ], }, '*.curtain.*': { - 'interval_seconds': 60, 'switch_properties': 'motor_reverse', 'select_properties': 'mode', 'chunk_coordinators': [ @@ -2225,7 +2226,13 @@ ], }, '*.derh.*': { + 'interval_seconds': 120, 'select_properties': 'fan_level', + 'chunk_coordinators': [ + {'interval': 20, 'props': 'on,mode,target_humidity,fan_level'}, + {'interval': 25, 'props': 'relative_humidity,temperature'}, + {'interval': 300, 'props': 'filter_life_level,filter_left_time,filter_used_time'}, + ], }, '*.desk.*': { 'button_properties': 'motor_control,reset', @@ -2252,6 +2259,9 @@ 'sensor_properties': 'left_time,water', 'switch_properties': 'on', 'number_select_properties': 'wash_mode,wash_time,target_water_level,water_level', + 'chunk_coordinators': [ + {'interval': 10, 'props': 'on,wash_mode,wash_time,target_water_level,water_level,left_time'}, + ], }, '*.fan.*': { 'button_actions': 'turn_left,turn_right', @@ -2304,7 +2314,6 @@ 'button_actions': 'start_cook,pause,cancel_cooking', }, '*.light.*': { - 'interval_seconds': 60, 'number_properties': 'off_delay_time,light_on_gradient_time,light_off_gradient_time', 'switch_properties': 'flex_switch,night_light_switch', 'button_actions': 'toggle', @@ -2332,6 +2341,9 @@ }, '*.microwave.*': { 'sensor_properties': 'left_time,heat_level,cook_time', + 'chunk_coordinators': [ + {'interval': 10, 'props': 'status,left_time,heat_level,cook_time'}, + ], }, '*.mosq.*': { 'sensor_properties': 'repellent_left_level,liquid_left', @@ -2350,12 +2362,14 @@ 'sensor_properties': 'temperature,left_time,cook_time,working_time', 'number_properties': 'target_temperature', 'switch_properties': 'oven.on', + 'chunk_coordinators': [ + {'interval': 10, 'props': 'oven.on,target_temperature,temperature,left_time,cook_time,working_time'}, + ], }, '*.plantmonitor.*': { 'sensor_properties': 'soil_ec,illumination,temperature,relative_humidity', }, '*.plug.*': { - 'interval_seconds': 60, 'chunk_coordinators': [ {'interval': 10, 'props': 'switch.on,electric_power'}, ], @@ -2371,6 +2385,9 @@ }, '*.sensor_occupy.*': { 'sensor_properties': 'illumination,has_someone_duration,no_one_duration', + 'chunk_coordinators': [ + {'interval': 10, 'props': 'occupancy_status,has_someone_duration,no_one_duration'}, + ], }, '*.sensor_smoke.*': { 'binary_sensor_attributes': 'smoke_status',