-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Split weekday from time condition into a separate condition #356
Comments
Looking at source I noticed that time condition is specified in https://github.com/home-assistant/core/blob/dev/homeassistant/helpers/condition.py#L394-L448 If we agree on naming I can try to hack something out. What do you think about two options?
or:
in the second example, all the days would default to I think that to keep backward compatibility we can leave weekday as part of time condition, but mark it as deprecated and remove it in one of upcoming releases. |
Personally, I like this one: - condition: weekday
days:
- mon
- wed
- fri |
@Santobert thanks for the comment. It will be easier for me with this config :) |
Just wondering, would something like: - condition: time
days:
- weekday or: - condition: time
days:
- weekend or: - condition: time
days:
- mon
- thu be better? |
@Swamp-Ig this is already possible. You can add weekday as part of time condition (https://www.home-assistant.io/docs/scripts/conditions/#time-condition) |
I've created PR home-assistant/core#32848 but I have some formatting issues with flak8 and black. I can't get both rules to pass. |
docs PR got approved. |
Most of them use discord, so try it there. There are currently a lot of PRs pending, so be patient :) |
@Santobert thanks for the tip 😉 |
I don't see any motivation why we should split the time weekday condition to a separate condition. Only one of |
@MartinHjelmare yes that's true, but please take a look at home-assistant/frontend#3833. |
We normally don't take the frontend into consideration when making backend architecture decisions. Why can't the frontend have a selector that decides which one of the three possible conditions to add? |
Needed in automation editor. |
Why is it needed in automation editor? |
I agree that it is already possible, I just think it might be nice to keep the frontend and yaml config aligned, but don't think it would be worth the breaking change. |
Recent discussion on the forum: https://community.home-assistant.io/t/condition-day-was-schedule-trigger-type/219551 |
What do you think about this prototype: More details here: home-assistant/frontend#3833 (comment) |
@Misiu The prototype looks nice! |
I think this issue can be closed: https://www.home-assistant.io/blog/#automation-editor-has-now-weekday-support ? |
Yes, this is now there. |
Context
I'm trying to add weekday selection to the automation editor (home-assistant/frontend#3833). I had most of the work done, but while building thinks I got feeling that time and weekdays should be split as two separate conditions.
Proposal
I'm proposing to remove weekday from time condition and create a separate condition.
So instead:
you will write:
Consequences
This will allow me to split a single complex condition into two:
to:
The text was updated successfully, but these errors were encountered: