Skip to content

fix(homeassistant): coerce watch_all instead of bool()#24053

Open
kronexoi wants to merge 1 commit into
NousResearch:mainfrom
kronexoi:fix/homeassistant-watch-all-quoted-bool
Open

fix(homeassistant): coerce watch_all instead of bool()#24053
kronexoi wants to merge 1 commit into
NousResearch:mainfrom
kronexoi:fix/homeassistant-watch-all-quoted-bool

Conversation

@kronexoi

Copy link
Copy Markdown
Contributor

Summary

This fixes Home Assistant watch_all parsing when the config value is a quoted string.

Previously, watch_all: "false" was interpreted via bool(...), which evaluates any non-empty string as True. That caused the Home Assistant adapter to treat "false" as enabled and forward events that should have been dropped when no explicit filters were configured.

What changed

  • replace raw bool(extra.get("watch_all", False)) with is_truthy_value(..., default=False)
  • add regression coverage for quoted "false" at initialization time
  • add regression coverage to verify that "false" does not allow unfiltered event forwarding

Repro

With config equivalent to:

platforms:
homeassistant:
extra:
watch_all: "false"

the adapter previously behaved as if watch_all were enabled.

Testing

pytest tests/gateway/test_homeassistant.py -q -k "watch_all"
4 passed in 4.52s

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery labels May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants