Skip to content

Commit ca8bcc6

Browse files
authored
0.9.23 (#187)
* Fix M81 issue * add new supporters
1 parent 6af433b commit ca8bcc6

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Check out my other plugins [here](https://plugins.octoprint.org/by_author/#jneil
6565
- [@Mearman](https://github.com/Mearman)
6666
- [@TxBillbr](https://github.com/TxBillbr)
6767
- Gerald Dachs
68+
- [@TheTuxKeeper](https://github.com/thetuxkeeper)
6869

6970
### Support My Efforts
7071
I, jneilliii, programmed this plugin for fun and do my best effort to support those that have issues with it, please return the favor and leave me a tip or become a Patron if you find this plugin helpful and want me to continue future development.

octoprint_tplinksmartplug/__init__.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
plugin_name = "OctoPrint-TPLinkSmartplug"
1515

1616
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
17-
plugin_version = "0.9.22"
17+
plugin_version = "0.9.23"
1818

1919
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
2020
# module

0 commit comments

Comments
 (0)