Skip to content

Fix CLI on/off control parameters#2

Open
bricelb wants to merge 1 commit into
Doekse:mainfrom
bricelb:fix-cli-on-off-control-params
Open

Fix CLI on/off control parameters#2
bricelb wants to merge 1 commit into
Doekse:mainfrom
bricelb:fix-cli-on-off-control-params

Conversation

@bricelb

@bricelb bricelb commented May 25, 2026

Copy link
Copy Markdown

Summary

Fix meross-cli control ... --on/--off so the generated control params match the current meross-iot ability APIs.

The CLI previously mapped --on / --off only to onoff. That satisfies some registry metadata, but toggle.set and light.set expect on, while garage.set expects open. In practice, commands could print Command executed successfully! while the device state did not change.

This change maps the boolean CLI state to all compatible fields:

  • on for toggle/light abilities
  • open for garage abilities
  • numeric onoff for registry/legacy callers

Validation

  • npm run lint --workspace packages/meross-cli passes with existing warnings only
  • npm test --workspace packages/meross-cli --if-present exits successfully; no package test script is currently defined
  • node --check packages/meross-cli/cli/meross-cli.js
  • Reproduced against real Meross lights: before this patch light.set --on reported success but status remained off; after the same mapping fix, toggle.set --on/off and light.set --on/off changed state correctly

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant