Skip to content

Commit

Permalink
Filter-out faulty system_mode reports inside multiple reports.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrrstux committed Jan 3, 2025
1 parent 3417da5 commit 34b2d08
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions zhaquirks/bosch/rbsh_trv0_zb_eu.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,30 @@ def handle_cluster_general_request(
hdr, args, dst_addressing=dst_addressing
)

attr = args[0][0]

"""Pass-through reports of all attributes, except for system_mode."""
if attr.attrid != SYSTEM_MODE_ATTR.id:
has_system_mode_report = False
for attr in args.attribute_reports:
if attr.attrid == SYSTEM_MODE_ATTR.id:
has_system_mode_report = True
break

if not has_system_mode_report:
return super().handle_cluster_general_request(
hdr, args, dst_addressing=dst_addressing
)
else:
update_attributes = [
attr
for attr in args.attribute_reports
if attr.attrid != SYSTEM_MODE_ATTR.id
]
if len(update_attributes) > 0:
msg = foundation.GENERAL_COMMANDS[
foundation.GeneralCommand.Report_Attributes
].schema(attribute_reports=update_attributes)
return super().handle_cluster_general_request(
hdr, msg, dst_addressing=dst_addressing
)


class BoschUserInterfaceCluster(CustomCluster, UserInterface):
Expand Down

0 comments on commit 34b2d08

Please sign in to comment.