diff --git a/custom_components/xiaomi_miot/core/device_customizes.py b/custom_components/xiaomi_miot/core/device_customizes.py index ff90a5843..70453b3a7 100644 --- a/custom_components/xiaomi_miot/core/device_customizes.py +++ b/custom_components/xiaomi_miot/core/device_customizes.py @@ -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, diff --git a/custom_components/xiaomi_miot/sensor.py b/custom_components/xiaomi_miot/sensor.py index de66fdd32..c9892602f 100644 --- a/custom_components/xiaomi_miot/sensor.py +++ b/custom_components/xiaomi_miot/sensor.py @@ -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 @@ -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