From 561dbe56b5709e4754374510f7a85a0ff2accd6b Mon Sep 17 00:00:00 2001 From: Alone Date: Thu, 31 Oct 2024 10:55:05 +0800 Subject: [PATCH] migrate bath heater --- custom_components/xiaomi_miot/climate.py | 9 --------- custom_components/xiaomi_miot/core/device_customizes.py | 6 +++++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/custom_components/xiaomi_miot/climate.py b/custom_components/xiaomi_miot/climate.py index 4ef2a8f95..7dc311d4b 100644 --- a/custom_components/xiaomi_miot/climate.py +++ b/custom_components/xiaomi_miot/climate.py @@ -254,15 +254,6 @@ async def async_update(self): add_fans([self._subs[des]], update_before_add=True) add_switches = self._add_entities.get('switch') - for p in self._miot_service.properties.values(): - if not (p.format == 'bool' and p.readable and p.writeable): - continue - if p.name in self._power_modes: - continue - if self._prop_power and self._prop_power.name == p.name: - continue - self._update_sub_entities(p, None, 'switch') - if self._miot_service.get_action('start_wash'): pnm = 'action_wash' prop = self._miot_service.get_property('status') diff --git a/custom_components/xiaomi_miot/core/device_customizes.py b/custom_components/xiaomi_miot/core/device_customizes.py index ccef87899..bf54e9f0e 100644 --- a/custom_components/xiaomi_miot/core/device_customizes.py +++ b/custom_components/xiaomi_miot/core/device_customizes.py @@ -1642,6 +1642,9 @@ 'yeelink.bhf_light.v13': { 'miot_type': 'urn:miot-spec-v2:device:bath-heater:0000A028:yeelink-v13:1', }, + 'yeelink.bhf_light.*': { + 'switch_properties': 'heating,blow,ventilation', + }, 'yeelink.light.dn2grp': { 'cloud_delay_update': 7, }, @@ -1942,7 +1945,8 @@ }, '*.bhf_light.*': { 'main_miot_services': 'ptc_bath_heater', - 'number_properties': 'off_delay_time', + 'sensor_properties': 'temperature', + 'number_properties': 'target_temperature,off_delay_time', }, '*.blanket.*': { 'sensor_properties': 'temperature',