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

Fallback to wildcard subscription if no explicit subscription defined #338

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,14 @@ async def _subscribe_node(self, node_id: int) -> None:

if len(attr_subscriptions) > 50:
# prevent memory overload on node and fallback to wildcard sub if too many
# individual subscriptions
# individual subscriptions (e.g. bridges)
attr_subscriptions = "*" # type: ignore[assignment]

if node.attribute_subscriptions == []:
# temp fix for backwards compatbility with HA releases below 2023.7
# fallback to wildcard subscriptions if we have no explicit
# node subscriptions defined.
# TODO: remove this after HA release 2023.8
attr_subscriptions = "*" # type: ignore[assignment]

# check if we already have an subscription for this node,
Expand Down