mirror of
https://github.com/Anonym-tsk/smart-domofon.git
synced 2025-12-07 20:17:00 +03:00
LED brightness
This commit is contained in:
@@ -47,15 +47,13 @@ substitutions:
|
|||||||
short_click_time_from: 50ms # Short button click min time
|
short_click_time_from: 50ms # Short button click min time
|
||||||
short_click_time_to: 1000ms # Long button click min time
|
short_click_time_to: 1000ms # Long button click min time
|
||||||
|
|
||||||
# Led configuration
|
|
||||||
led_brightness: "0.7"
|
|
||||||
|
|
||||||
########### End user configuration ###########
|
########### End user configuration ###########
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
base: !include domofon_packages/base.yaml
|
base: !include domofon_packages/base.yaml
|
||||||
api: !include domofon_packages/api.yaml
|
api: !include domofon_packages/api.yaml
|
||||||
#mqtt: !include domofon_packages/mqtt.yaml
|
#mqtt: !include domofon_packages/mqtt.yaml
|
||||||
|
number: !include domofon_packages/number.yaml
|
||||||
script: !include domofon_packages/script.yaml
|
script: !include domofon_packages/script.yaml
|
||||||
output: !include domofon_packages/output.yaml
|
output: !include domofon_packages/output.yaml
|
||||||
switch: !include domofon_packages/switch.yaml
|
switch: !include domofon_packages/switch.yaml
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ light:
|
|||||||
transition_length: 0ms
|
transition_length: 0ms
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: rgb_led
|
id: rgb_led
|
||||||
brightness: $led_brightness
|
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||||
red: 0%
|
red: 0%
|
||||||
green: 100%
|
green: 100%
|
||||||
blue: 0%
|
blue: 0%
|
||||||
@@ -48,7 +48,7 @@ light:
|
|||||||
transition_length: 0ms
|
transition_length: 0ms
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: rgb_led
|
id: rgb_led
|
||||||
brightness: $led_brightness
|
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||||
red: 100%
|
red: 100%
|
||||||
green: 0%
|
green: 0%
|
||||||
blue: 0%
|
blue: 0%
|
||||||
|
|||||||
20
ge1mer/domofon_packages/number.yaml
Normal file
20
ge1mer/domofon_packages/number.yaml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
number:
|
||||||
|
- platform: template
|
||||||
|
name: "${board_name} LED Brightness"
|
||||||
|
icon: "mdi:led-on"
|
||||||
|
id: led_brightness
|
||||||
|
optimistic: true
|
||||||
|
restore_value: true
|
||||||
|
initial_value: 7
|
||||||
|
min_value: 0
|
||||||
|
max_value: 10
|
||||||
|
step: 1
|
||||||
|
set_action:
|
||||||
|
then:
|
||||||
|
if:
|
||||||
|
condition:
|
||||||
|
light.is_on: rgb_led
|
||||||
|
then:
|
||||||
|
light.control:
|
||||||
|
id: rgb_led
|
||||||
|
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||||
@@ -103,7 +103,7 @@ script:
|
|||||||
- script.execute: led_off
|
- script.execute: led_off
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: rgb_led
|
id: rgb_led
|
||||||
brightness: $led_brightness
|
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||||
red: 0%
|
red: 0%
|
||||||
green: 0%
|
green: 0%
|
||||||
blue: 100%
|
blue: 100%
|
||||||
@@ -117,7 +117,7 @@ script:
|
|||||||
- script.execute: led_off
|
- script.execute: led_off
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: rgb_led
|
id: rgb_led
|
||||||
brightness: $led_brightness
|
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||||
red: 0%
|
red: 0%
|
||||||
green: 100%
|
green: 100%
|
||||||
blue: 0%
|
blue: 0%
|
||||||
@@ -137,7 +137,7 @@ script:
|
|||||||
- script.execute: led_off
|
- script.execute: led_off
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: rgb_led
|
id: rgb_led
|
||||||
brightness: $led_brightness
|
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||||
red: 100%
|
red: 100%
|
||||||
green: 0%
|
green: 0%
|
||||||
blue: 0%
|
blue: 0%
|
||||||
@@ -149,7 +149,7 @@ script:
|
|||||||
- script.execute: led_off
|
- script.execute: led_off
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: rgb_led
|
id: rgb_led
|
||||||
brightness: $led_brightness
|
brightness: !lambda "return id(led_brightness).state / 10;"
|
||||||
red: 0%
|
red: 0%
|
||||||
green: 70%
|
green: 70%
|
||||||
blue: 100%
|
blue: 100%
|
||||||
|
|||||||
Reference in New Issue
Block a user