Skip to content

fix state trigger hold on unrelated state updates#847

Open
dmamelin wants to merge 1 commit into
custom-components:masterfrom
dmamelin:dm-fix4
Open

fix state trigger hold on unrelated state updates#847
dmamelin wants to merge 1 commit into
custom-components:masterfrom
dmamelin:dm-fix4

Conversation

@dmamelin
Copy link
Copy Markdown
Contributor

Fixes #845.

The new state_trigger treated unrelated state events as a false trigger condition. For entities like media_player, attribute-only updates can arrive while the watched state remains unchanged, for example playing. Those updates could reset state_hold, causing the trigger to never fire.

This changes the new state_trigger decorator to ignore unrelated state events, matching the legacy trigger behavior. A regression check was added to test_state_trigger for attribute-only updates during state_hold.

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.

state_hold in version 2.0 doesn't work in all cases, but still works with legacy_decorators: true

1 participant