You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This now matches clusters instead of cluster handlers_cluster_match=ClusterMatch(
server_clusters=frozenset({PowerConfiguration.cluster_id}),
profile_device_types=frozenset(
{(zha.PROFILE_ID, SMARTTHINGS_ARRIVAL_SENSOR_DEVICE_TYPE)}
),
)
# There is a similar `_client_cluster_config`_server_cluster_config= {
PowerConfiguration.cluster_id: ClusterConfig(
bind=True,
attributes={
PowerConfiguration.AttributeDefs.battery_voltage: AttrConfig(
read_on_startup=False,
reporting=REPORT_CONFIG_BATTERY_SAVE,
),
PowerConfiguration.AttributeDefs.battery_percentage_remaining: AttrConfig(
read_on_startup=False,
reporting=REPORT_CONFIG_BATTERY_SAVE,
),
PowerConfiguration.AttributeDefs.battery_size: AttrConfig(
read_on_startup=True,
),
PowerConfiguration.AttributeDefs.battery_quantity: AttrConfig(
read_on_startup=True,
),
},
),
}
For an individual cluster, all entities referencing that cluster will have their configuration combined and ZHA will sync it up.
A few thoughts:
Cluster handlers that do not create entities but are used for binding need to be explicitly handled. I think the simplest way to do this would be to merge Add event platform for client cluster #594 and live with having duplicate entities before device deprecating automation triggers.
We should maybe introduce version for entity configuration? Right now, changing a reporting interval or adding new attributes requires a user to manually click "reconfigure". An alternative would be to keep track of all binding and reporting config in the zigpy database and diff it with the ZHA defaults. We'd need to track whether configuration has been automatically configured or if it was manually pushed, in case someone overrides reporting.
Cluster handlers that do not create entities but are used for binding need to be explicitly handled. I think the simplest way to do this would be to merge #594 and live with having duplicate entities before device deprecating automation triggers.
I agree. I think adding event entity support first is the way to go
We should maybe introduce version for entity configuration? Right now, changing a reporting interval or adding new attributes requires a user to manually click "reconfigure". An alternative would be to keep track of all binding and reporting config in the zigpy database and diff it with the ZHA defaults. We'd need to track whether configuration has been automatically configured or if it was manually pushed, in case someone overrides reporting.
we need several things to do this correctly .... an additional thing that comes to mind is queuing of commands for sleepy devices for example (if we want to auto apply changes when a new version is created).
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
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.
See #653 for a different approach.
As an example:
For an individual cluster, all entities referencing that cluster will have their configuration combined and ZHA will sync it up.
A few thoughts:
versionfor entity configuration? Right now, changing a reporting interval or adding new attributes requires a user to manually click "reconfigure". An alternative would be to keep track of all binding and reporting config in the zigpy database anddiffit with the ZHA defaults. We'd need to track whether configuration has been automatically configured or if it was manually pushed, in case someone overrides reporting.