From 73225c20280ba727f3f714975a119838609a1a6e Mon Sep 17 00:00:00 2001 From: Alone Date: Wed, 27 Mar 2024 22:41:37 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=8A=20improve=20for=20fridge=20(#1426)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/xiaomi_miot/core/device_customizes.py | 4 ++++ custom_components/xiaomi_miot/sensor.py | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/custom_components/xiaomi_miot/core/device_customizes.py b/custom_components/xiaomi_miot/core/device_customizes.py index e5dc62710..9b45734ec 100644 --- a/custom_components/xiaomi_miot/core/device_customizes.py +++ b/custom_components/xiaomi_miot/core/device_customizes.py @@ -1763,6 +1763,10 @@ 'select_properties': 'heat_level,motor_control', 'number_properties': 'target_time,target_temperature', }, + '*.fridge.*': { + 'switch_properties': 'on', + 'number_properties': 'target_temperature', + }, '*.heater.*': { 'switch_properties': 'heater.on,horizontal_swing,alarm.alarm,delay.delay', 'number_properties': 'countdown_time,delay_time', diff --git a/custom_components/xiaomi_miot/sensor.py b/custom_components/xiaomi_miot/sensor.py index 5a0609232..de66fdd32 100644 --- a/custom_components/xiaomi_miot/sensor.py +++ b/custom_components/xiaomi_miot/sensor.py @@ -287,7 +287,7 @@ async def async_update_for_main_entity(self): ) self._update_sub_entities( ['on'], - [self._miot_service.name, 'router', 'wifi', 'guest_wifi', 'fridge_chamber'], + [self._miot_service.name, 'router', 'wifi', 'guest_wifi'], domain='switch', ) self._update_sub_entities( @@ -313,11 +313,6 @@ async def async_update_for_main_entity(self): ['bed', 'backrest_control', 'leg_rest_control'], domain='cover', ) - self._update_sub_entities( - ['target_temperature'], - ['fridge_chamber'], - domain='number', - ) @property def device_class(self):