mirror of
https://github.com/Anonym-tsk/smart-domofon.git
synced 2026-01-03 15:19:03 +03:00
Leds new logic
This commit is contained in:
@@ -62,13 +62,27 @@ script:
|
||||
- logger.log: "Set state 'No call'"
|
||||
- lambda: |-
|
||||
if (id(mode_auto_open_once)) {
|
||||
id(led_blink_green_1_on).execute();
|
||||
if (id(mode_mute) || id(mode_mute_once)) {
|
||||
id(led_green_and_blue_blink).execute();
|
||||
} else {
|
||||
id(led_blink_green_on).execute();
|
||||
}
|
||||
} else if (id(mode_auto_open)) {
|
||||
id(led_green_on_soft).execute();
|
||||
if (id(mode_mute) || id(mode_mute_once)) {
|
||||
id(led_green_on_blue_blink).execute();
|
||||
} else {
|
||||
id(led_green_on).execute();
|
||||
}
|
||||
} else if (id(mode_auto_reject)) {
|
||||
id(led_red_on_soft).execute();
|
||||
} else if (id(mode_mute) || id(mode_mute_once)) {
|
||||
id(led_blue_on_soft).execute();
|
||||
if (id(mode_mute) || id(mode_mute_once)) {
|
||||
id(led_red_on_blue_blink).execute();
|
||||
} else {
|
||||
id(led_red_on).execute();
|
||||
}
|
||||
} else if (id(mode_mute)) {
|
||||
id(led_blue_on).execute();
|
||||
} else if (id(mode_mute_once)) {
|
||||
id(led_blink_blue_on).execute();
|
||||
} else {
|
||||
id(led_off).execute();
|
||||
}
|
||||
@@ -86,22 +100,33 @@ script:
|
||||
id(call_accept).execute();
|
||||
id(mode_auto_open_once) = false;
|
||||
} else {
|
||||
id(led_blink_red_1_on).execute();
|
||||
id(led_blink_red_on).execute();
|
||||
}
|
||||
|
||||
# Permanent blink green led with one flash
|
||||
- id: led_blink_green_1_on
|
||||
# Permanent blink green led
|
||||
- id: led_blink_green_on
|
||||
then:
|
||||
- logger.log: "Led blink green on"
|
||||
- logger.log: "Led green blink"
|
||||
- script.execute: led_off
|
||||
- light.turn_on:
|
||||
id: rgb_led
|
||||
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||
effect: "Blink Green"
|
||||
|
||||
# Once blink blue led with one flash
|
||||
- id: led_blink_blue_1_once
|
||||
# Permanent blink blue led
|
||||
- id: led_blink_blue_on
|
||||
then:
|
||||
- logger.log: "Led blink blue once"
|
||||
- logger.log: "Led blue blink"
|
||||
- script.execute: led_off
|
||||
- light.turn_on:
|
||||
id: rgb_led
|
||||
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||
effect: "Blink Blue"
|
||||
|
||||
# Once blink blue led
|
||||
- id: led_blink_blue_once
|
||||
then:
|
||||
- logger.log: "Led blue once"
|
||||
- script.execute: led_off
|
||||
- light.turn_on:
|
||||
id: rgb_led
|
||||
@@ -113,10 +138,10 @@ script:
|
||||
- delay: 200ms
|
||||
- script.execute: led_off
|
||||
|
||||
# Permanent on green led with soft brightness
|
||||
- id: led_green_on_soft
|
||||
# Permanent on green led
|
||||
- id: led_green_on
|
||||
then:
|
||||
- logger.log: "Led green soft on"
|
||||
- logger.log: "Led green on"
|
||||
- script.execute: led_off
|
||||
- light.turn_on:
|
||||
id: rgb_led
|
||||
@@ -126,17 +151,18 @@ script:
|
||||
blue: 0%
|
||||
transition_length: 100ms
|
||||
|
||||
# Permanent blink red led with one flash
|
||||
- id: led_blink_red_1_on
|
||||
# Permanent blink red led
|
||||
- id: led_blink_red_on
|
||||
then:
|
||||
- logger.log: "Led blink red"
|
||||
- logger.log: "Led red blink"
|
||||
- script.execute: led_off
|
||||
- light.turn_on:
|
||||
id: rgb_led
|
||||
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||
effect: "Blink Red"
|
||||
|
||||
# Permanent on red led with soft brightness
|
||||
- id: led_red_on_soft
|
||||
# Permanent on red led with
|
||||
- id: led_red_on
|
||||
then:
|
||||
- logger.log: "Led red on"
|
||||
- script.execute: led_off
|
||||
@@ -148,10 +174,10 @@ script:
|
||||
blue: 0%
|
||||
transition_length: 100ms
|
||||
|
||||
# Permanent on soft blue led
|
||||
- id: led_blue_on_soft
|
||||
# Permanent on blue led
|
||||
- id: led_blue_on
|
||||
then:
|
||||
- logger.log: "Led blue soft on"
|
||||
- logger.log: "Led blue on"
|
||||
- script.execute: led_off
|
||||
- light.turn_on:
|
||||
id: rgb_led
|
||||
@@ -161,16 +187,39 @@ script:
|
||||
blue: 100%
|
||||
transition_length: 100ms
|
||||
|
||||
# Permanent on red led and blink blue led
|
||||
- id: led_red_on_blue_blink
|
||||
then:
|
||||
- logger.log: "Led red on blue blink"
|
||||
- script.execute: led_off
|
||||
- light.turn_on:
|
||||
id: rgb_led
|
||||
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||
effect: "Red Blink Blue"
|
||||
|
||||
# Permanent on green led and blink blue led
|
||||
- id: led_green_on_blue_blink
|
||||
then:
|
||||
- logger.log: "Led green on blue blink"
|
||||
- script.execute: led_off
|
||||
- light.turn_on:
|
||||
id: rgb_led
|
||||
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||
effect: "Green Blink Blue"
|
||||
|
||||
# Blink green and blue leds
|
||||
- id: led_green_and_blue_blink
|
||||
then:
|
||||
- logger.log: "Led green and blue blink"
|
||||
- script.execute: led_off
|
||||
- light.turn_on:
|
||||
id: rgb_led
|
||||
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||
effect: "Blink Green Blue"
|
||||
|
||||
# Turn off leds
|
||||
- id: led_off
|
||||
then:
|
||||
- light.turn_on:
|
||||
id: rgb_led
|
||||
brightness: 0%
|
||||
red: 0%
|
||||
green: 0%
|
||||
blue: 0%
|
||||
transition_length: 100ms
|
||||
- light.turn_off:
|
||||
id: rgb_led
|
||||
transition_length: 0ms
|
||||
Reference in New Issue
Block a user