mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-06-21 14:20:17 +08:00
feat: add an alongside switch entity for the water heater (#1115)
This commit is contained in:
@ -601,7 +601,7 @@ class MIoTSpecProperty(_MIoTSpecBase):
|
||||
if value is None:
|
||||
return None
|
||||
if self.format_ == int:
|
||||
return int(value)
|
||||
return int(round(value))
|
||||
if self.format_ == float:
|
||||
return round(value, self.precision)
|
||||
if self.format_ == bool:
|
||||
|
@ -18,5 +18,45 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"urn:miot-spec-v2:device:water-heater:0000A02A:xiaomi-yms2:1": [
|
||||
{
|
||||
"iid": 2,
|
||||
"type": "urn:miot-spec-v2:service:switch:0000780C:xiaomi-yms2:1",
|
||||
"description": "Switch",
|
||||
"properties": [
|
||||
{
|
||||
"iid": 6,
|
||||
"type": "urn:miot-spec-v2:property:on:00000006:xiaomi-yms2:1",
|
||||
"description": "Switch Status",
|
||||
"format": "bool",
|
||||
"access": [
|
||||
"read",
|
||||
"write",
|
||||
"notify"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"urn:miot-spec-v2:device:water-heater:0000A02A:zimi-h03:1": [
|
||||
{
|
||||
"iid": 2,
|
||||
"type": "urn:miot-spec-v2:service:switch:0000780C:zimi-h03:1",
|
||||
"description": "Switch",
|
||||
"properties": [
|
||||
{
|
||||
"iid": 6,
|
||||
"type": "urn:miot-spec-v2:property:on:00000006:zimi-h03:1",
|
||||
"description": "Switch Status",
|
||||
"format": "bool",
|
||||
"access": [
|
||||
"read",
|
||||
"write",
|
||||
"notify"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -397,7 +397,7 @@ SPEC_SERVICE_TRANS_MAP: dict = {
|
||||
}
|
||||
},
|
||||
'optional': {
|
||||
'properties': {'on', 'temperature', 'target-temperature', 'mode'}
|
||||
'properties': {'temperature', 'target-temperature', 'mode'}
|
||||
},
|
||||
'entity': 'water_heater'
|
||||
},
|
||||
|
Reference in New Issue
Block a user