#插排电源按钮单击、长按功能
on_multi_click:
#长按5s以上,重置为出厂模式,进入配网状态
- timing:
- ON for at least 5s
then:
- logger.log: "Long press."
- switch.turn_on: ${node_id}_factory_reset
invalid_cooldown: 0s
#双击
- timing:
- ON for at most 0.5s
- OFF for at most 0.5s
- ON for at most 0.5s
- OFF for at least 0.2s
then:
- logger.log: "Double click."
- switch.toggle: relay_slave_logic
invalid_cooldown: 0s
#单击
- timing:
- ON for at most 0.3s
- OFF for at least 0.2s
then:
- logger.log: "Single click."
- switch.toggle: key_button_logic
invalid_cooldown: 0s