Skip to content

Commit

Permalink
馃 improve for zhimi.fan.za3/za4 (#1686)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed May 24, 2024
1 parent 3238b6f commit c938c36
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/xiaomi_miot/core/device_customizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,12 @@
'brightness_for_on': 0,
'brightness_for_off': 2,
},
'zhimi.fan.za3': {
'miot_type': 'urn:miot-spec-v2:device:fan:0000A005:zhimi-za3:3',
},
'zhimi.fan.za4': {
'miot_type': 'urn:miot-spec-v2:device:fan:0000A005:zhimi-za4:3',
},
'zhimi.fan.*': {
'switch_properties': 'anion,alarm,horizontal_swing,vertical_swing',
'number_properties': 'horizontal_angle,vertical_angle,off_delay',
Expand Down
10 changes: 10 additions & 0 deletions custom_components/xiaomi_miot/core/miio2miot_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2754,6 +2754,16 @@ def cbk(prop, params, props, **kwargs):
'template': '{{ 1 if value|int(0) > 0 else 0 }}',
'set_template': '{{ [value|int(0) * 25] }}',
},
'prop.2.6': {
'prop': 'speed_level',
'setter': True,
'template': '{{ props.natural_level|default(value,true)|int(0) }}',
'set_template': '{% set nlv = props.natural_level|default(0)|int(0) %}'
'{{ {'
'"method": "set_natural_level" if nlv else "set_speed_level",'
'"params": [value|int(0)],'
'} }}',
},
'prop.4.1': {
'prop': 'buzzer',
'setter': True,
Expand Down

0 comments on commit c938c36

Please sign in to comment.