Skip to content

Commit

Permalink
🔄 improve for update status
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Dec 28, 2024
1 parent 1b37ce5 commit 41a9d68
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion custom_components/xiaomi_miot/core/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
41 changes: 29 additions & 12 deletions custom_components/xiaomi_miot/core/device_customizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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': {
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -2164,17 +2159,24 @@
{'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.*': {
'switch_properties': 'air_purifier.on,alarm.alarm,anion,uv',
'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.*': {
Expand Down Expand Up @@ -2217,15 +2219,20 @@
],
},
'*.curtain.*': {
'interval_seconds': 60,
'switch_properties': 'motor_reverse',
'select_properties': 'mode',
'chunk_coordinators': [
{'interval': 10, 'props': 'status,current_position,target_position'},
],
},
'*.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',
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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'},
],
Expand All @@ -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',
Expand Down

0 comments on commit 41a9d68

Please sign in to comment.