Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure filtered_attributes and filtered_optimistic are also regex #13047

Merged
merged 3 commits into from
Jul 6, 2022

Conversation

sjorge
Copy link
Contributor

@sjorge sjorge commented Jul 5, 2022

There was some further discussion on #12988 after it got merged pointing out that filtered_cache, unlike the other filtered_* is regex based.

Having it as a regex is actually more flexible, so this PR updates filtered_attributes and filtered_optimistic to also be regex based.

For testing I kept my exiting config unchanged and noticed everything still worked, then I added ^ and $ anchors and everything also still worked, providing a 'bare' attribute name mostly will still work fine, unless something like 'color' is provided it will now match attribute containing color in the name.

Further testing nothing broke on a test network with a single bulb:

  • verified filtered_attributes still removes the attributes from the publish
  • verified filtered_optimistic did not trigger optimistic updates for 'state' and 'brightness' (remove reporting, update either and observe no change + restore reporting, update either and get one update triggered by the attributeReport)
  • verified filtered_cache (not touched) still removed attributes from being cached

@sjorge
Copy link
Contributor Author

sjorge commented Jul 5, 2022

tests pass even without modifying because they were all unique named properties.

sjorge added 3 commits July 5, 2022 18:52
Bring filtered_attributes and filtered_optimistic in line with the newer filtered_cache.
All three of them are now regex matches instead of absolute matches.
@sjorge sjorge force-pushed the filtered_rework branch from 3ee6f92 to 9b75ccb Compare July 5, 2022 16:57
@sjorge
Copy link
Contributor Author

sjorge commented Jul 5, 2022

Redid the same tests

@Koenkk Koenkk merged commit db021e6 into Koenkk:dev Jul 6, 2022
@Koenkk
Copy link
Owner

Koenkk commented Jul 6, 2022

Thanks! Mind making a pr for the docs?

@sjorge sjorge deleted the filtered_rework branch July 9, 2022 17:37
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