Skip to content

Commit

Permalink
implement LevelControl Stop
Browse files Browse the repository at this point in the history
  • Loading branch information
pipiche38 committed Oct 15, 2023
1 parent 350f939 commit 44488d4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Classes/GroupMgtv2/GrpDomoticz.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
zcl_group_onoff_on,
zcl_group_window_covering_off,
zcl_group_window_covering_on,
zcl_group_move_to_level_stop,
zcl_group_window_covering_stop)

WIDGET_STYLE = {
Expand Down Expand Up @@ -684,6 +685,14 @@ def processCommand(self, unit, GrpId, Command, Level, Color_):
sValue = "On"
self.Devices[unit].Update(nValue=int(nValue), sValue=str(sValue))

elif Command in ( "Stop",) and self.ListOfGroups[GrpId]["Cluster"] == "0102":
# Windowscovering Stop
zcl_group_window_covering_stop(self, GrpId, "01", EPout)

elif Command in ( "Stop",) and self.ListOfGroups[GrpId]["Cluster"] == "0008":
# SetLevel Off
zcl_group_move_to_level_stop(self, GrpId, EPout)

elif Command == "Set Level":
# Level: % value of move
# Converted to value , raw value from 0 to 255
Expand Down
11 changes: 10 additions & 1 deletion Zigbee/zclCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ def zcl_move_to_level_with_onoff(self, nwkid, EPout, OnOff, level, transition="0
return send_zigatecmd_zcl_noack(self, nwkid, "0081", data)
return send_zigatecmd_zcl_ack(self, nwkid, "0081", data)

def zcl_move_to_level_stop(self, nwkid, EPout, ackIsDisabled=DEFAULT_ACK_MODE):
self.log.logging("zclCommand", "Debug", "zcl_move_to_level_stop %s %s" % (nwkid, EPout, ))
zcl_command_formated_logging( self, "zcl_move_to_level_stop", nwkid, EPout, "0008", "Stop", ackIsDisabled)
if "ControllerInRawMode" in self.pluginconf.pluginConf and self.pluginconf.pluginConf["ControllerInRawMode"]:
return zcl_raw_level_move_to_level(self, nwkid, ZIGATE_EP, EPout, "Stop")

def zcl_group_move_to_level_with_onoff(self, nwkid, EPout, OnOff, level, transition="0000", ackIsDisabled=DEFAULT_ACK_MODE):
self.log.logging("zclCommand", "Debug", "zcl_move_to_level_with_onoff %s %s %s %s %s" % (nwkid, EPout, OnOff, level, transition))
Expand All @@ -457,7 +462,11 @@ def zcl_group_move_to_level_with_onoff(self, nwkid, EPout, OnOff, level, transit
data = "%02d" % ADDRESS_MODE["group"] + nwkid + ZIGATE_EP + EPout + OnOff + level + transition
return send_zigatecmd_raw(self, "0081", data)


def zcl_group_move_to_level_stop(self, nwkid, EPout, ackIsDisabled=DEFAULT_ACK_MODE):
self.log.logging("zclCommand", "Debug", "zcl_move_to_level_stop %s %s" % (nwkid, EPout, ))
zcl_command_formated_logging( self, "zcl_move_to_level_stop", nwkid, EPout, "0008", "Stop", ackIsDisabled)
if "ControllerInRawMode" in self.pluginconf.pluginConf and self.pluginconf.pluginConf["ControllerInRawMode"]:
return zcl_raw_level_move_to_level(self, nwkid, ZIGATE_EP, EPout, "Stop", groupaddrmode=True)

# Cluster 0102 ( Window Covering )
##################################
Expand Down

0 comments on commit 44488d4

Please sign in to comment.