Skip to content

Fix fan_mode + fan_mode_duration rejection in set_state#173

Open
crrapi wants to merge 1 commit intopyalarmdotcom:masterfrom
crrapi:master
Open

Fix fan_mode + fan_mode_duration rejection in set_state#173
crrapi wants to merge 1 commit intopyalarmdotcom:masterfrom
crrapi:master

Conversation

@crrapi
Copy link
Copy Markdown

@crrapi crrapi commented Jul 5, 2025

This fixes a logic bug in set_state() where passing both --fan-mode and --fan-mode-duration would incorrectly raise a "only one attribute at a time" error — even though that combination is supposed to be allowed.

The issue was that fan_mode_duration was being treated as a separate top-level attribute in the mutual exclusivity check. So even when used correctly (with fan_mode), it got flagged.

What changed

  • Removed fan_mode_duration from the list of mutually exclusive fields.
  • The check that enforces fan_mode and fan_mode_duration must be passed together is still in place.

Why it matters

This unblocks valid usage patterns — including Home Assistant and CLI calls — that need to set both fan_mode and fan_mode_duration together.

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