-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New services adaptive_lighting.turn_on
turn_off
toggle
with optional switch/lights args
#559
base: main
Are you sure you want to change the base?
Conversation
'function too complex'
turn_on
turn_off
toggle
with optional switch/lights args
turn_on
turn_off
toggle
with optional switch/lights argsturn_on
turn_off
toggle
with optional switch/lights args
turn_on
turn_off
toggle
with optional switch/lights argsadaptive_lighting.turn_on
turn_off
toggle
with optional switch/lights args
pre-commit's |
move stuff out of `async_setup_entry`
@basnijholt Hello. Could you take a look at this PR if you find the time? Thanks. |
03c4e21
to
cfe565a
Compare
|
||
`adaptive_lighting.turn_on`, `adaptive_lighting.turn_off`, `adaptive_lighting.toggle` turn Adaptive Lighting on or off. | ||
|
||
TODO: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@th3w1zard1 could you add an explaination about what these methods can be used for?
Even I do not understand at the moment why adaptive_lighting.apply
couldn't do most of these things 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure no worries. The main problem with AL's switches are the fact that they need to be referenced by name and not the light
With this PR we use the new format you've introduced in 1.10.1 to allow even more flexibility
I have each individual light on their own individual switch. My main use case is turning off the sleep switches when My alarm goes off. With this I can pass the light ids.
Before this I had to use a naming scheme where each switch is light.adaptive_lighting_al_my_light_entity. Then i had to learn Jinja, and substring the adaptive_lighting_al to get my switch. I have a complete tutorial on my fork's README.md if you'd like more info
This pr saves about 5 actions per script in my env
I look forward to hearing your alternatives to this!
@@ -201,6 +206,19 @@ | |||
'documented defaults), or "configuration" (reverts to switch config defaults). ⚙️' | |||
) | |||
|
|||
CONF_WHICH_SWITCH, DEFAULT_WHICH_SWITCH = "switch_type", "main" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine that "main" is not available in 99% of the installations. Should we have no default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that sounds like a good idea
e4f4327
to
5fdc911
Compare
Now that we have lookups for our optional lights or switches arguments, I figure some new service calls to support that would be welcome.
Tests are written and everything else in
const.py
Ran into this problem while trying to modify some of my HASS automations. Mainly the wake-up script as it currently just disables adaptive lighting and does its own transitioning.
With this PR I simply need to call one service: