Skip to content

Commit

Permalink
👨‍🍳 add sub-entities for cykj.hood.jyj22 (#1630)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Apr 30, 2024
1 parent 1f2827c commit a1d7b60
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions custom_components/xiaomi_miot/core/device_customizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,20 @@
'main_miot_services': 'switch-2',
'exclude_miot_services': 'setting,wireless_switch',
},
'cykj.hood.jyj22': {
'sensor_properties': 'left_stove_level,right_stove_level,left_stove_timer,right_stove_timer,timer_mode',
'switch_properties': 'prop.2.9,hood_stove_switch,timer_alert_switch,low_power_alert,pose_recog_switch,'
'start_period_notify,pm_fresh_notify,auto_lighton_start,clean_notify,pm_notify_on',
'select_properties': 'clean_period',
'number_properties': 'prop.2.5,off_delay_time,start_period_set,pm_thresold,pm_fresh_time,pm_fresh_valueset,'
'turn_off_screen',
},
'cykj.hood.jyj22:battery': {
'state_class': '',
},
'cykj.hood.jyj22:battery_level': {
'state_class': '',
},

'deerma.humidifier.jsq4': {
'exclude_miot_services': None,
Expand Down
4 changes: 4 additions & 0 deletions custom_components/xiaomi_miot/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ async def async_added_to_hass(self):
cls = self.custom_config('state_class')
if cls in STATE_CLASSES:
self._attr_state_class = cls
elif cls in ['', False]:
self._attr_state_class = None

if uom := self.custom_config('unit_of_measurement'):
self._attr_native_unit_of_measurement = uom
Expand Down Expand Up @@ -465,6 +467,8 @@ async def async_added_to_hass(self):
cls = self.custom_config('state_class')
if cls in STATE_CLASSES:
self._attr_state_class = cls
elif cls in ['', False]:
self._attr_state_class = None

if uom := self.custom_config('unit_of_measurement'):
self._attr_native_unit_of_measurement = uom
Expand Down

0 comments on commit a1d7b60

Please sign in to comment.