Bump pyuptimerobot to 25.0.0#169572
Conversation
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
Hey there @ludeeus, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
aca10f5 to
7082790
Compare
There was a problem hiding this comment.
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
pyuptimerobotfrom24.0.1to25.0.0in manifest and requirements files. - Update the UptimeRobot switch implementation to use
async_pause_monitor/async_start_monitorwith 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_monitorto patchasync_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
),
),
| raise HomeAssistantError( | ||
| translation_domain=DOMAIN, | ||
| translation_key="api_exception", | ||
| translation_placeholders={"error": "Generic UptimeRobot exception"}, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Updated, even if was not changed in this PR ;-)
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
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: