-
-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Addition of a schedule configure service #80358
Addition of a schedule configure service #80358
Conversation
Adding in the ability to use a service to be able to change a schedule (so it can be done via automations etc).
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( |
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 really do think we should not add a service like this.
It will be complicated and is actually simulating an API. In such cases, templates or a calendar service would be much more fitting.
This PR doesn't actually change the schedule, additionally, how would this work for YAML users?
Looking at other helpers (like the input_* helpers), they have services to change the state. Lookint at any otherintegration, we do not have services to change integration configuration. This service introduced in this PR is not about changing the state, it is changing the configuration; which we general don't have anywhere.
../Frenck
The addition of a calendar service would be useful. Are you thinking the ability to add and remove items on a calendar via automations?
Instead of this, do you think the addition of schedule attributes (attributes for each time schedule that can be configurable within a schedule) would be more useful?
I now understand that it is only changing the state, due to it requiring a configuration change instead of a state change for the schedule sensor. I believe the ability to change the schedule at a push of a button would be beneficial to end users. What is your thoughts on this? |
There is an architectural issue and development progress on this. However, not directly related to this PR.
I don't understand the question. My initial response would therefore be: No.
See my previous response. |
I agree that this adds complexity we shouldn't want. If you know a time it should fire, you could set an input boolean state or keep an automation running. |
Adding in the ability to use a service call to be able to add / clear / change a schedule (so it can be done via automations etc).
I have one problem with the current configuration, it seems to work as expected - except it doesn't seem to last after restarts (it goes back to the previous configuration). I have checked the
.storage/schedule
file and it doesn't get updated after a update despite every other service example doing it in the same way that I have used.When calling the service, it will tell you that you are overlapping previously set times if you press the call service button twice - which is correct. So I know that the Home Assistant state machine is getting it - the states are updated in the user interface too. If a time window is covering the current time it the state of the schedule turns to on as expected. The problem seems to be when I click on the schedule itself to edit it, it does not show the adjusted values - even though the state has changed to match what is happening behind the scenes.
If I could have some help on figuring out the reason for this would be greatly appreciated.
Proposed change
The addition of a schedule service to allow the adapting of a schedule via automations.
I am using it to block out a day within a schedule of mine just by the press of a button (for user friendliness and ease).
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: