Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughAdds CLI commands to get and set device settings and corresponding client methods to call Homey’s device settings endpoints; includes an AI-context note about required scopes and API key usage. (50 words) Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
3dc9af0 to
9ef9d2c
Compare
Add commands to get and set device settings (separate from capabilities): - `devices get-settings <name-or-id>` - View all device settings - `devices set-setting <name-or-id> <key> <value>` - Change a setting Common settings include: - zone_activity_disabled: Exclude sensor from zone activity - climate_exclude: Exclude device from climate control - Driver-specific configuration options Note: Requires `homey.device` scope (not just `homey.device.control`) Fixes #3
Summary
Closes #3
Adds two new commands for managing device settings:
homeyctl devices get-settings <name-or-id>- View all settings for a devicehomeyctl devices set-setting <name-or-id> <key> <value>- Modify a device settingAlso updates
homeyctl aiwith documentation for these commands.Important: OAuth Scope Limitation
@fishfisher - heads up on a discovery during implementation:
Athom's OAuth system does NOT support the
homey.devicescope required for changing device settings. The only available device scopes are:homey.device.readonly- read device infohomey.device.control- control devices (on/off, dim, etc.)This means OAuth tokens (from
homeyctl login) cannot modify device settings.Workaround
Users who need to change device settings must create an API key at my.homey.app:
homeyctl config set-token <api-key>The CLI includes a clear error message explaining this when users hit the "Missing Scopes" error.
Test plan
devices get-settingsagainst real Homeydevices set-settingagainst real Homey with API keyhomeyctl aidocumentationSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.