Skip to content

Add Risco set_time service#139015

Merged
joostlek merged 14 commits intohome-assistant:devfrom
FredericMa:feature/time-service
Dec 15, 2025
Merged

Add Risco set_time service#139015
joostlek merged 14 commits intohome-assistant:devfrom
FredericMa:feature/time-service

Conversation

@FredericMa
Copy link
Copy Markdown
Contributor

@FredericMa FredericMa commented Feb 21, 2025

Proposed change

This PR adds a set_time service 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

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @OnFreund, mind taking a look at this pull request as it has been labeled with an integration (risco) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of risco can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign risco Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

Comment thread homeassistant/components/risco/strings.json Outdated
@OnFreund
Copy link
Copy Markdown
Contributor

Please split the dependency bump to a separate PR.
The refactoring should probably be a separate PR as well.

@FredericMa FredericMa marked this pull request as draft February 22, 2025 18:29
@MartinHjelmare MartinHjelmare changed the title Risco - Add set_time service Add Risco set_time service Feb 22, 2025
@FredericMa FredericMa closed this Feb 23, 2025
@FredericMa FredericMa reopened this Feb 23, 2025
@FredericMa FredericMa marked this pull request as ready for review February 23, 2025 20:28
Comment thread homeassistant/components/risco/services.py
Comment thread homeassistant/components/risco/const.py Outdated
Comment thread homeassistant/components/risco/__init__.py
@edenhaus edenhaus removed the dependency Pull requests marked as a dependency upgrade label Feb 26, 2025
frenck
frenck previously requested changes Mar 2, 2025
Comment thread homeassistant/components/risco/services.py
Comment thread tests/components/risco/test_services.py Outdated
@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented Mar 2, 2025

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant Bot requested a review from frenck March 3, 2025 19:43
Comment thread homeassistant/components/risco/services.py
Comment thread tests/components/risco/test_services.py Outdated
@home-assistant home-assistant Bot marked this pull request as draft April 8, 2025 09:50
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 7, 2025

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.
If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes.
Thank you for your contribution!

@github-actions github-actions Bot added the stale label Jun 7, 2025
@FredericMa
Copy link
Copy Markdown
Contributor Author

Forgot about this one

@github-actions github-actions Bot removed the stale label Jun 7, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 6, 2025

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.
If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes.
Thank you for your contribution!

@github-actions github-actions Bot added the stale label Aug 6, 2025
@FredericMa
Copy link
Copy Markdown
Contributor Author

Still planning on doing this.

@github-actions github-actions Bot removed the stale label Aug 6, 2025
@silamon
Copy link
Copy Markdown
Contributor

silamon commented Dec 7, 2025

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.

@FredericMa FredericMa marked this pull request as ready for review December 14, 2025 21:34
Copilot AI review requested due to automatic review settings December 14, 2025 21:34
@home-assistant home-assistant Bot requested a review from joostlek December 14, 2025 21:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread homeassistant/components/risco/services.py
Comment thread tests/components/risco/test_services.py
Comment thread homeassistant/components/risco/services.py Outdated
@FredericMa FredericMa requested a review from Copilot December 14, 2025 21:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I want to thank you for your patience ❤️

@joostlek joostlek dismissed frenck’s stale review December 15, 2025 19:14

time is frozen now

@joostlek joostlek merged commit d780188 into home-assistant:dev Dec 15, 2025
35 of 36 checks passed
@FredericMa FredericMa deleted the feature/time-service branch December 15, 2025 19:18
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants