feat(capabilities): Add target power capabilities#627
Conversation
…ilities Added new capabilities for target power, target charging power, and target discharging power to enhance energy management features.
There was a problem hiding this comment.
Pull request overview
This PR adds three new capability definitions for energy management: target power, target charging power, and target discharging power. Each capability provides setable/getable power values in watts with slider UI controls and flow automation support.
Changes:
- Added three new JSON capability definitions with multilingual support (16 languages)
- Integrated trigger and action flow configurations for each capability
- Updated the main capabilities registry to include the new power-related capabilities
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| target_power.json | Defines general target power capability with flow triggers/actions |
| target_power_charge.json | Defines target charging power capability with flow triggers/actions |
| target_power_discharge.json | Defines target discharging power capability with flow triggers/actions |
| capabilities.json | Registers the three new capabilities in alphabetical order |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ng, and discharging capabilities
…tions Ensure that the capability options for target_power_mode include both 'automatic' and 'override' values to prevent invalid configurations.
Ensure that the exclude range for target_power capability options includes 0, throwing an error if it does not.
…eries Ensure that the target_power min/max range for home batteries includes 0 to allow for idle state. This validation prevents incorrect configurations that could lead to operational issues.
45d0d1f to
b3b0e13
Compare
Changed the options for the 'target_power_mode' capability from 'automatic' and 'override' to 'device' and 'homey' to better reflect the available modes.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… device types All target_power devices need idle (0W), not just home batteries.
…eMax capability options
Replace nested `exclude: { min, max }` with top-level `excludeMin`/`excludeMax`
properties across all repos.
Added hints to the target power and target power mode capabilities to clarify the functionality of "Homey" and "Device" control options for users. This enhances user understanding of how to manage target power settings effectively.
|
@copilot update Homey version number in minCompatibility to 12.13.0 |
…er capabilities Co-authored-by: RobinBol <5762579+RobinBol@users.noreply.github.com>
[WIP] Add target power capabilities for home battery devices
This pull request introduces new capabilities for target power control and enforces stricter validation rules for drivers that use these capabilities, especially for home battery devices. It also adds comprehensive tests to ensure these validations work as intended.
New capabilities for target power control:
target_powerandtarget_power_modeto the list of available capabilities incapabilities.json.target_powercapability definition, supporting numeric values (in watts), UI configuration, flow triggers/actions, and localization.target_power_modecapability definition, supporting an enum for control mode (device or Homey), UI configuration, flow triggers/conditions/actions, and localization.Validation improvements for driver manifests:
lib/App/index.jsto validate that:target_power_modevalues include both 'device' and 'homey'.capabilitiesOptions.excludeis set fortarget_power, its range must include 0.target_powermin/max must include 0 to allow idle state.Test coverage enhancements:
test/validate-driver-manifest.jsto ensure home battery drivers withtarget_powercapability require min/max ranges including 0, and that non-home-battery drivers are not subject to this rule.TODO:
minCompatibility.