From 52d0214766fcf213e85ddcb5480be4d955a280ec Mon Sep 17 00:00:00 2001 From: lucka-me Date: Thu, 9 Jan 2025 02:09:55 +0800 Subject: [PATCH] feat: add climate support for electric blanket - Enable the climate feature (control panel, HomeKit Bridge accessory, etc.) for electric-blanket devices - Add device conversion for electric-blanket, simply map to heater entity --- .../xiaomi_home/miot/specs/specv2entity.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/custom_components/xiaomi_home/miot/specs/specv2entity.py b/custom_components/xiaomi_home/miot/specs/specv2entity.py index 9e36011..3c8ce8f 100644 --- a/custom_components/xiaomi_home/miot/specs/specv2entity.py +++ b/custom_components/xiaomi_home/miot/specs/specv2entity.py @@ -241,6 +241,29 @@ SPEC_DEVICE_TRANS_MAP: dict[str, dict | str] = { }, }, 'entity': 'heater' + }, + 'electric-blanket': { + 'required': { + 'electric-blanket': { + 'required': { + 'properties': { + 'on': {'read', 'write'} + } + }, + 'optional': { + 'properties': {'target-temperature'} + }, + } + }, + 'optional': { + 'environment': { + 'required': {}, + 'optional': { + 'properties': {'temperature'} + } + }, + }, + 'entity': 'heater' } }