Watts: add timer mode service#169846
Conversation
|
Hey there @devender-verma-ww, @ssi-spyro, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new watts.activate_timer_mode service for Watts Vision thermostats, allowing users to switch a thermostat into “timer mode” with a target temperature and duration, and updates the integration to align with the upstream client API change for get_device.
Changes:
- Add
activate_timer_modeplatform entity service wired to a newWattsVisionClimate.async_activate_timer_modemethod. - Add user-facing service metadata (services.yaml, strings.json, icons.json) and integration setup to register the service.
- Update coordinator/tests to reflect the updated
visionpluspythonget_device()signature and add tests for the new service.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/components/watts/test_switch.py | Updates fast-polling assertion to match updated get_device() call signature. |
| tests/components/watts/test_climate.py | Adds tests for the new timer mode service and updates fast-polling assertion for get_device(). |
| homeassistant/components/watts/strings.json | Adds translated exception messages and service metadata for activate_timer_mode. |
| homeassistant/components/watts/services.yaml | Declares the new service and its UI selectors/fields. |
| homeassistant/components/watts/services.py | Registers the new platform entity service and validates duration input shape/range. |
| homeassistant/components/watts/icons.json | Adds an icon for the new service. |
| homeassistant/components/watts/coordinator.py | Removes the refresh=True argument from get_device() calls. |
| homeassistant/components/watts/const.py | Adds constants for the new service and its duration field. |
| homeassistant/components/watts/climate.py | Implements async_activate_timer_mode with validation, error translation, fast polling, and refresh. |
| homeassistant/components/watts/init.py | Registers services during integration setup and adds config-entry-only schema. |
60381d4 to
316d360
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
# Conflicts: # homeassistant/components/watts/climate.py # homeassistant/components/watts/icons.json # tests/components/watts/test_climate.py
| _LOGGER.debug( | ||
| "Successfully activated timer mode: %s%s for %d min on %s", | ||
| temperature, | ||
| self.temperature_unit, | ||
| duration_minutes, | ||
| self.device_id, |
| from datetime import timedelta | ||
| import logging | ||
| from typing import Any | ||
|
|
||
| from visionpluspython.exceptions import WattsVisionError | ||
| from visionpluspython.models import ThermostatDevice, ThermostatMode |
|
Please make sure you have the new docs PR ready :) |
|
@joostlek doc PR added : home-assistant/home-assistant.io#45311 |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…-timer * upstream/dev: Bump infrared-protocols to 5.1.0 (home-assistant#170365) Clean up template engine after extension modularization (home-assistant#170346) Bump axis to v71 (home-assistant#170347) Enhance WebDAV metadata download with concurrency (home-assistant#170223) Add target temperature sensor for ViCare RadiatorActuator devices (home-assistant#170102) Bump pyzbar to 0.1.9 (home-assistant#170076) homematicip_cloud: fix HmIP-FLC lock state polarity (home-assistant#170159) Watts: add timer mode service (home-assistant#169846) Set parallel updates for Ecowitt platforms (home-assistant#170349) Add config flow to Avea (home-assistant#168070) Cleanup Eurotronic number platform (home-assistant#170337) Add number platform to eurotronic_cometblue (home-assistant#168119)
Breaking change
Proposed change
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: