Skip to content

Commit

Permalink
🛀 fix miio2miot for yeelink.bhf_light.v6 (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Mar 17, 2022
1 parent 50e079d commit 1144c13
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
26 changes: 25 additions & 1 deletion custom_components/xiaomi_miot/core/miio2miot_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,16 +909,25 @@
'prop.3.1': {
'prop': 'bh_mode',
'template': '{{ '
'7 if "fastdefog" in value else '
'6 if "fastwarm" in value else '
'1 if "coolwind" in value else '
'2 if "warmwind" in value else '
'3 if "venting" in value else '
'4 if "drying" in value else '
'5 if "defog" in value else '
'0 }}',
'set_template': '{{ '
'["coolwind", 2] if value == 1 else '
'["warmwind", 2] if value == 2 else '
'["venting", 2] if value == 3 else '
'["drying", 2] if value == 4 else '
'["drying"] if value == 4 else '
'["defog"] if value == 5 else '
'["fastwarm"] if value == 6 else '
'["fastdefog"] if value == 7 else '
'["ventingoff"] if props.bh_mode == "venting" else '
'["windoff"] if props.bh_mode == "coolwind" else '
'["windoff"] if props.bh_mode == "warmwind" else '
'["bh_off", 0] }}',
},
'prop.3.2': {'prop': 'aim_temp', 'setter': 'set_temp'},
Expand All @@ -929,6 +938,21 @@
'template': 'yeelink_bhf_light_v5_fan_levels',
'set_template': '{{ [props.bh_mode, value - 1] }}',
},
'prop.3.102': {
'prop': 'bh_mode', 'setter': True,
'template': '{{ "warm" in value }}',
'set_template': '{{ ["warmwind" if value else "windoff"] }}',
},
'prop.3.103': {
'prop': 'bh_mode', 'setter': True,
'template': '{{ "coolwind" in value }}',
'set_template': '{{ ["coolwind" if value else "windoff"] }}',
},
'prop.3.104': {
'prop': 'bh_mode', 'setter': True,
'template': '{{ "venting" in value }}',
'set_template': '{{ ["venting" if value else "ventingoff"] }}',
},
'action.3.1': {'setter': 'bh_mode', 'set_template': '{{ ["bh_off", 0] }}'},
},
},
Expand Down
34 changes: 34 additions & 0 deletions custom_components/xiaomi_miot/core/miot_specs_extend.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,19 @@
{
"iid": 3,
"properties": [
{
"iid": 1,
"value-list": [
{"value": 0, "description": "Idle"},
{"value": 1, "description": "Fan"},
{"value": 2, "description": "Heat"},
{"value": 3, "description": "Ventilate"},
{"value": 4, "description": "Dry"},
{"value": 5, "description": "Defog"},
{"value": 6, "description": "Quick Heat"},
{"value": 7, "description": "Quick Defog"}
]
},
{
"iid": 101,
"type": "urn:miot-spec-v2:property:fan-level",
Expand All @@ -410,6 +423,27 @@
{"value": 2, "description": "Medium"},
{"value": 3, "description": "High"}
]
},
{
"iid": 102,
"type": "urn:miot-spec-v2:property:heating",
"description": "Heating",
"format": "bool",
"access": ["read", "write"]
},
{
"iid": 103,
"type": "urn:miot-spec-v2:property:blow",
"description": "Blow",
"format": "bool",
"access": ["read", "write"]
},
{
"iid": 104,
"type": "urn:miot-spec-v2:property:ventilation",
"description": "Ventilation",
"format": "bool",
"access": ["read", "write"]
}
]
}
Expand Down

0 comments on commit 1144c13

Please sign in to comment.