@@ -918,24 +918,23 @@ def processGCODE(self, comm_instance, phase, cmd, cmd_type, gcode, *args, **kwar
918918 return
919919
920920 if gcode == "M80" :
921- if cmd .startswith ("M80" ):
922- plugip = re .sub (r'^M80\s?' , '' , cmd )
923- self ._tplinksmartplug_logger .debug ("Received M80 command, attempting power on of %s." % plugip )
924- plug = self .plug_search (self ._settings .get (["arrSmartplugs" ]),"ip" ,plugip )
925- self ._tplinksmartplug_logger .debug (plug )
926- if plug and plug ["gcodeEnabled" ]:
927- t = threading .Timer (int (plug ["gcodeOnDelay" ]),self .gcode_turn_on ,[plug ])
928- t .start ()
929- return
930- elif cmd .startswith ("M81" ):
931- plugip = re .sub (r'^M81\s?' , '' , cmd )
932- self ._tplinksmartplug_logger .debug ("Received M81 command, attempting power off of %s." % plugip )
933- plug = self .plug_search (self ._settings .get (["arrSmartplugs" ]),"ip" ,plugip )
934- self ._tplinksmartplug_logger .debug (plug )
935- if plug and plug ["gcodeEnabled" ]:
936- t = threading .Timer (int (plug ["gcodeOffDelay" ]),self .gcode_turn_off ,[plug ])
937- t .start ()
938- return
921+ plugip = re .sub (r'^M80\s?' , '' , cmd )
922+ self ._tplinksmartplug_logger .debug ("Received M80 command, attempting power on of %s." % plugip )
923+ plug = self .plug_search (self ._settings .get (["arrSmartplugs" ]),"ip" ,plugip )
924+ self ._tplinksmartplug_logger .debug (plug )
925+ if plug and plug ["gcodeEnabled" ]:
926+ t = threading .Timer (int (plug ["gcodeOnDelay" ]),self .gcode_turn_on ,[plug ])
927+ t .start ()
928+ return
929+ if gcode == "M81" :
930+ plugip = re .sub (r'^M81\s?' , '' , cmd )
931+ self ._tplinksmartplug_logger .debug ("Received M81 command, attempting power off of %s." % plugip )
932+ plug = self .plug_search (self ._settings .get (["arrSmartplugs" ]),"ip" ,plugip )
933+ self ._tplinksmartplug_logger .debug (plug )
934+ if plug and plug ["gcodeEnabled" ]:
935+ t = threading .Timer (int (plug ["gcodeOffDelay" ]),self .gcode_turn_off ,[plug ])
936+ t .start ()
937+ return
939938
940939 def processAtCommand (self , comm_instance , phase , command , parameters , tags = None , * args , ** kwargs ):
941940 self ._logger .info (command )
0 commit comments