Skip to content

Commit

Permalink
🐈 improve for mmgg feeder (#2003)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Dec 5, 2024
1 parent 6d6b827 commit 01422b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 6 additions & 6 deletions custom_components/xiaomi_miot/core/device_customizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,29 +1046,29 @@
},
'mmgg.feeder.fi1': {
'chunk_properties': 1,
'state_property': 'pet_food_left_level',
'button_actions': 'pet_food_out,resetclean,reset_desiccant_life',
'binary_sensor_properties': 'outletstatus,doorstatus',
'sensor_properties': 'fault,outfood_num,cleantime,desiccant_left_time',
'sensor_properties': 'fault,pet_food_left_level,outfood_num,cleantime,desiccant_left_time',
'number_properties': 'key_stat,indicator_light.on',
'select_actions': 'pet_food_out',
'exclude_miot_properties': 'outfood_id,contrycode,feddplan_string,factory_result,phon_time_zone'
'feedplan_hour,feedplan_min,feedplan_unit,feedplan_stat,feedplan_id,getfeedplan_num',
},
'mmgg.feeder.inland': {
'chunk_properties': 1,
'state_property': 'pet_food_left_level',
'button_actions': 'pet_food_out,resetclean,reset_desiccant_life',
'binary_sensor_properties': 'outletstatus,doorstatus',
'sensor_properties': 'outfood_num,foodstatus,desiccant_left_time,cleantime',
'sensor_properties': 'pet_food_left_level,outfood_num,foodstatus,desiccant_left_time,cleantime',
'switch_properties': 'key_stat,indicator_light.on',
'select_actions': 'pet_food_out',
'exclude_miot_properties': 'fault,outfood_id,contrycode,feddplan_string,factory_result,phon_time_zone,'
'feedplan_hour,feedplan_min,feedplan_unit,feedplan_stat,feedplan_id,getfeedplan_num',
},
'mmgg.feeder.petfeeder': {
'state_property': 'pet_food_left_level',
'button_actions': 'reset_desiccant_life',
'sensor_properties': 'feed_today,desiccant_left_time,cleantime',
'sensor_properties': 'pet_food_left_level,feed_today,desiccant_left_time,cleantime',
'switch_properties': 'feedstatus',
'select_actions': 'pet_food_out',
},
'mmgg.litter_box.lbc1': {
'binary_sensor_properties': 'warehouse_uninstall,cover_open,roller_uninstall,device_dump,'
Expand Down
5 changes: 5 additions & 0 deletions custom_components/xiaomi_miot/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
RestoreNumber,
NumberMode,
)
from homeassistant.helpers.event import async_call_later

from . import (
DOMAIN,
Expand Down Expand Up @@ -74,6 +75,10 @@ def set_state(self, data: dict):
async def async_set_native_value(self, value: float):
await self.device.async_write({self.attr: value})

if self._miot_action:
self._attr_native_value = None
async_call_later(self.hass, 0.5, self.schedule_update_ha_state)

XEntity.CLS[ENTITY_DOMAIN] = NumberEntity


Expand Down

0 comments on commit 01422b2

Please sign in to comment.