Skip to content

Bump pyuptimerobot to 25.0.0#169572

Open
chemelli74 wants to merge 5 commits intohome-assistant:devfrom
chemelli74:chemelli74-uptimerobot
Open

Bump pyuptimerobot to 25.0.0#169572
chemelli74 wants to merge 5 commits intohome-assistant:devfrom
chemelli74:chemelli74-uptimerobot

Conversation

@chemelli74
Copy link
Copy Markdown
Contributor

Proposed change

Fix broken switches

release: https://github.com/ludeeus/pyuptimerobot/releases/tag/25.0.0
changelog: ludeeus/pyuptimerobot@24.0.1...25.0.0

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • 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.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

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 diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

@chemelli74 chemelli74 added this to the 2026.5.0 milestone Apr 30, 2026
Copilot AI review requested due to automatic review settings April 30, 2026 19:53
@chemelli74 chemelli74 requested a review from ludeeus as a code owner April 30, 2026 19:53
Copy link
Copy Markdown
Contributor

@home-assistant home-assistant Bot left a comment

Choose a reason for hiding this comment

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

There is a merge conflict.

@home-assistant home-assistant Bot added dependency Pull requests marked as a dependency upgrade has-tests integration: uptimerobot labels Apr 30, 2026
@home-assistant home-assistant Bot marked this pull request as draft April 30, 2026 19:53
@home-assistant
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

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

Code owner commands

Code owners of uptimerobot can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign uptimerobot Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

@chemelli74 chemelli74 force-pushed the chemelli74-uptimerobot branch from aca10f5 to 7082790 Compare April 30, 2026 19:56
@chemelli74 chemelli74 marked this pull request as ready for review April 30, 2026 19:56
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

Updates the UptimeRobot integration to work with pyuptimerobot 25.0.0 (including switch API changes) and adjusts tests to match the upstream library’s new constants/method names.

Changes:

  • Bump pyuptimerobot from 24.0.1 to 25.0.0 in manifest and requirements files.
  • Update the UptimeRobot switch implementation to use async_pause_monitor / async_start_monitor with shared exception handling via a new decorator.
  • Adjust tests for moved constants and add coverage for sensors when monitor status is missing.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
homeassistant/components/uptimerobot/utils.py Adds a decorator to centralize handling of UptimeRobot API exceptions for entity command methods.
homeassistant/components/uptimerobot/switch.py Switch now calls async_pause_monitor/async_start_monitor instead of the old edit API.
homeassistant/components/uptimerobot/sensor.py Returns None when monitor status is missing so state becomes unknown.
homeassistant/components/uptimerobot/manifest.json Bumps integration requirement to pyuptimerobot==25.0.0.
requirements_all.txt Pins pyuptimerobot to 25.0.0.
requirements_test_all.txt Pins pyuptimerobot to 25.0.0 for tests.
tests/components/uptimerobot/test_switch.py Updates some patches to new API methods/constants (but still has remaining outdated patches).
tests/components/uptimerobot/test_sensor.py Adds test for missing monitor status; updates imports.
tests/components/uptimerobot/test_config_flow.py / test_diagnostics.py / common.py Updates imports to pyuptimerobot.const for API path constants.
Comments suppressed due to low confidence (1)

tests/components/uptimerobot/test_switch.py:62

  • Update the remaining switch tests that still patch async_edit_monitor to patch async_pause_monitor/async_start_monitor, otherwise those error-path assertions won't exercise the code anymore after the switch implementation change.
            "pyuptimerobot.UptimeRobot.async_pause_monitor",
            return_value=mock_uptimerobot_api_response(
                api_path=API_PATH_MONITOR_DETAIL, data=MOCK_UPTIMEROBOT_MONITOR_PAUSED
            ),
        ),

Comment thread homeassistant/components/uptimerobot/utils.py Outdated
Comment thread homeassistant/components/uptimerobot/utils.py Outdated
Copilot AI review requested due to automatic review settings April 30, 2026 22:05
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 11 out of 11 changed files in this pull request and generated 2 comments.

Comment thread tests/components/uptimerobot/test_switch.py
Comment thread homeassistant/components/uptimerobot/utils.py Outdated
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 11 out of 11 changed files in this pull request and generated 2 comments.

Comment thread tests/components/uptimerobot/test_switch.py
Comment thread homeassistant/components/uptimerobot/utils.py Outdated
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="api_exception",
translation_placeholders={"error": "Generic UptimeRobot exception"},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We shouldn't add a string as a placeholder as these strings can't be translated and that will look weird in an exception in a non-English UI

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated, even if was not changed in this PR ;-)

@home-assistant home-assistant Bot marked this pull request as draft May 3, 2026 12:21
@chemelli74 chemelli74 marked this pull request as ready for review May 3, 2026 12:40
Copilot AI review requested due to automatic review settings May 3, 2026 12:40
@home-assistant home-assistant Bot requested a review from joostlek May 3, 2026 12:40
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 11 out of 11 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants