Skip to content

Commit

Permalink
better fix on Group
Browse files Browse the repository at this point in the history
  • Loading branch information
pipiche38 committed Oct 15, 2023
1 parent ece1174 commit 350f939
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Classes/GroupMgtv2/GrpDomoticz.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def best_group_widget(self, GroupId):
# }

GroupWidgetType = None
GroupWidgetStyle = None

self.logging("Debug", "best_group_widget Device - %s" % str(self.ListOfGroups[GroupId]["Devices"]))
for NwkId, devEp, iterIEEE in self.ListOfGroups[GroupId]["Devices"]:
Expand All @@ -207,10 +208,14 @@ def best_group_widget(self, GroupId):
WidgetType = self.ListOfDevices[NwkId]["Ep"][devEp]["ClusterType"][DomoDeviceUnit]
self.logging("Debug", "------------ GroupWidget: %s WidgetType: %s" % (GroupWidgetType, WidgetType))

if WidgetType == "LvlControl" and "Blind" in self.ListOfDevices[NwkId]["Type"]:
GroupWidgetStyle = "BlindPercentInverted"

if WidgetType in ("VenetianInverted", "VanneInverted", "CurtainInverted"):
# Those widgets are commanded via cluster Level Control
GroupWidgetType = "LvlControl"
return WIDGET_STYLE.get("VenetianInverted", WIDGET_STYLE["ColorControlFull"])
GroupWidgetStyle = "VenetianInverted"
continue

if GroupWidgetType is None and WidgetType in WIDGET_STYLE:
GroupWidgetType = WidgetType
Expand Down Expand Up @@ -245,7 +250,6 @@ def best_group_widget(self, GroupId):
GroupWidgetType = WidgetType
continue


if WidgetType in ("Venetian", "WindowCovering", "BlindPercentInverted"):
GroupWidgetType = WidgetType

Expand Down Expand Up @@ -281,13 +285,13 @@ def best_group_widget(self, GroupId):
else:
self.ListOfGroups[GroupId]["Cluster"] = ""

self.logging(
"Debug",
"best_group_widget for GroupId: %s Found WidgetType: %s Widget: %s"
% (GroupId, GroupWidgetType, WIDGET_STYLE.get(GroupWidgetType, WIDGET_STYLE["ColorControlFull"])),
)
self.logging( "Debug", "best_group_widget for GroupId: %s Found WidgetType: %s Widget: %s" % (
GroupId, GroupWidgetType, WIDGET_STYLE.get(GroupWidgetType, WIDGET_STYLE["ColorControlFull"])), )

return WIDGET_STYLE.get(GroupWidgetType, WIDGET_STYLE["ColorControlFull"])
if GroupWidgetStyle is None:
GroupWidgetStyle = GroupWidgetType

return WIDGET_STYLE.get(GroupWidgetStyle, WIDGET_STYLE["ColorControlFull"])


def update_domoticz_group_device(self, GroupId):
Expand Down

0 comments on commit 350f939

Please sign in to comment.