Add Risco set_time service#139015
Conversation
|
Hey there @OnFreund, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
Please split the dependency bump to a separate PR. |
4e84038 to
7e5617f
Compare
This reverts commit 9cfdacd.
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
|
Forgot about this one |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
|
Still planning on doing this. |
As long as pull requests remain in draft, reviewers won't spend time on it. If you're asking for feedback to their comments or extra help, undraft the pull request so they can help you out. There are also merge conflicts on the merge request. If you can update it in the meantime, that will speed up review. |
There was a problem hiding this comment.
Pull request overview
This PR adds a set_time service to the Risco integration, allowing users to set the time on their alarm panel when using a local connection. The service is needed because some Risco panels can only maintain one connection, preventing automatic time synchronization with a time server, which leads to clock drift over time.
Key changes:
- New service registration and implementation for setting panel time
- Support for both explicit time values and automatic current time usage
- Validation to ensure the service only works with local (not cloud) connections
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/components/risco/test_services.py |
Comprehensive test coverage for the new set_time service including validation scenarios |
homeassistant/components/risco/strings.json |
User-facing error messages and service descriptions |
homeassistant/components/risco/services.yaml |
Service schema definition with config entry and optional time parameters |
homeassistant/components/risco/services.py |
Core service implementation with validation and time setting logic |
homeassistant/components/risco/models.py |
New LocalData dataclass for storing runtime data |
homeassistant/components/risco/icons.json |
Icon configuration for the service |
homeassistant/components/risco/const.py |
Service constant definition |
homeassistant/components/risco/__init__.py |
Integration setup to register services and use new models |
joostlek
left a comment
There was a problem hiding this comment.
Awesome! I want to thank you for your patience ❤️
Proposed change
This PR adds a
set_timeservice to the Risco integration to set the time of the alarm panel on a local connection.Reasoning behind it: The panel I have only allows one connection so it doesn't seem to be able to sync the time with a timeserver although it is configured to do so. Over a few weeks time there is a drift of 8 minutes between the current time and the time of the panel.
This service makes it possible to create an automation to update the time of the panel at a preferred interval.
Type of change
Additional information
Checklist
ruff format 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.To help with the load of incoming pull requests: