fix: correct _set_value return value for IntesisHomeLocal#76
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
IntesisHomeLocal._set_value()was returningNoneon success, causing all set commands (power, mode, fan speed, temperature, etc.) to incorrectly signal failure to callers.The root cause is two-fold:
{'success': True, 'data': None}—_request()was returningjson_response.get("data")which evaluates toNone_set_value()was passing the raw response through, so callers doingbool(await self._set_value(...))always receivedFalseeven on successFix
_request()now returns{}instead ofNonewhen a successful response has no data payload, preserving the semantic thatNonemeans failure_set_value()now returnsresult is not None— explicitlyTrueon success,Falseon failureImpact
IntesisHomeLocaldevicesIntesisHome) or IntesisBox — both have separate_set_valueimplementationsContext
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.