Skip to content

Commit

Permalink
Use light.turn_on instead of custom pyscript to adjust lights
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Kissling committed Aug 26, 2024
1 parent 9773e6f commit 026c22a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 73 deletions.
14 changes: 0 additions & 14 deletions automations/alarm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@
action:
- service: input_boolean.turn_off
entity_id: input_boolean.night_light_mode
- service: light.turn_on
entity_id: light.bedroom
data:
brightness: 1
- service: adaptive_lighting.apply
entity_id: switch.adaptive_lighting_bedroom
data:
lights: light.bedroom
adapt_brightness: false
turn_on_lights: true
- service: switch.turn_off
entity_id: switch.adaptive_lighting_bedroom
- delay:
seconds: 5
- service: light.turn_on
entity_id: light.bedroom
data:
Expand Down
4 changes: 2 additions & 2 deletions automations/lights.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
entity_id: sensor.light_bedroom
attribute: brightness
action:
service: pyscript.adjust_light
service: light.turn_on
data:
entity_id: "{{ state_attr(trigger.entity_id, 'target_entity_id') }}"
brightness: "{{ state_attr(trigger.entity_id, 'brightness') }}"
color_temp_kelvin: "{{ state_attr(trigger.entity_id, 'color_temp_kelvin') }}"
kelvin: "{{ state_attr(trigger.entity_id, 'color_temp_kelvin') }}"
transition: "{{ state_attr(trigger.entity_id, 'transition') }}"
2 changes: 2 additions & 0 deletions includes/lovelace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ resources:
type: module
- url: /hacsfiles/bar-card/bar-card.js
type: module
- url: /hacsfiles/Bubble-Card/bubble-card.js
type: module
- url: /hacsfiles/button-card/button-card.js
type: module
- url: /hacsfiles/compass-card/compass-card.js
Expand Down
57 changes: 0 additions & 57 deletions pyscript/lights.py

This file was deleted.

3 changes: 3 additions & 0 deletions sensors/lights.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
60
{% endif %}
target_entity_id: light.living_room
color_temp_kelvin: "{{ state_attr('switch.adaptive_lighting_living_room', 'color_temp_kelvin') }}"

light_corridor:
value_template: unknown
Expand All @@ -139,6 +140,7 @@
60
{% endif %}
target_entity_id: light.corridor
color_temp_kelvin: "{{ state_attr('switch.adaptive_lighting_corridor', 'color_temp_kelvin') }}"

light_bedroom:
value_template: unknown
Expand All @@ -153,3 +155,4 @@
{% endif %}
transition: 60
target_entity_id: light.bedroom
color_temp_kelvin: "{{ state_attr('switch.adaptive_lighting_bedroom', 'color_temp_kelvin') }}"

0 comments on commit 026c22a

Please sign in to comment.