Skip to content

fix: correct _set_value return value for IntesisHomeLocal#76

Merged
jnimmo merged 2 commits into
jnimmo:masterfrom
kesawi:fix/local-set-value-bool-return
May 17, 2026
Merged

fix: correct _set_value return value for IntesisHomeLocal#76
jnimmo merged 2 commits into
jnimmo:masterfrom
kesawi:fix/local-set-value-bool-return

Conversation

@kesawi

@kesawi kesawi commented May 17, 2026

Copy link
Copy Markdown
Contributor

Problem

IntesisHomeLocal._set_value() was returning None on success, causing all set commands (power, mode, fan speed, temperature, etc.) to incorrectly signal failure to callers.

The root cause is two-fold:

  1. The device responds to successful SET commands with {'success': True, 'data': None}_request() was returning json_response.get("data") which evaluates to None
  2. _set_value() was passing the raw response through, so callers doing bool(await self._set_value(...)) always received False even on success

Fix

  • _request() now returns {} instead of None when a successful response has no data payload, preserving the semantic that None means failure
  • _set_value() now returns result is not None — explicitly True on success, False on failure

Impact

  • Fixes all local HTTP set commands for IntesisHomeLocal devices
  • No impact on cloud (IntesisHome) or IntesisBox — both have separate _set_value implementations
  • All 59 existing tests pass

Context

This bug was discovered while testing dolkensp's hass-intesishome (jnimmo/hass-intesishome:PR #41) which introduced _expect_ack() to surface failed set commands as HA errors — the correct behaviour that exposed this pre-existing bug.

@jnimmo jnimmo merged commit 35069f7 into jnimmo:master May 17, 2026
2 of 4 checks passed
@kesawi kesawi deleted the fix/local-set-value-bool-return branch May 25, 2026 10:52
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.

2 participants