Skip to content

Commit

Permalink
replace deprecated getBoolean with get_boolean.
Browse files Browse the repository at this point in the history
  • Loading branch information
jneilliii committed Apr 14, 2022
1 parent 8c5fa30 commit 863caa3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions octoprint_tplinksmartplug/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ def on_event(self, event, payload):
if response["currentState"] == "on":
self._plugin_manager.send_plugin_message(self._identifier, response)
# Error Event
if event == Events.ERROR and self._settings.getBoolean(["event_on_error_monitoring"]) is True:
if event == Events.ERROR and self._settings.get_boolean(["event_on_error_monitoring"]) is True:
self._tplinksmartplug_logger.debug("powering off due to %s event." % event)
for plug in self._settings.get(['arrSmartplugs']):
if plug["event_on_error"] is True:
Expand Down Expand Up @@ -759,8 +759,8 @@ def on_event(self, event, payload):
self._printer.select_file(self._autostart_file, False, printAfterSelect=True)
self._autostart_file = None
# File Uploaded Event
if event == Events.UPLOAD and self._settings.getBoolean(["event_on_upload_monitoring"]):
if payload.get("print", False) or self._settings.getBoolean(["event_on_upload_monitoring_always"]): # implemented in OctoPrint version 1.4.1
if event == Events.UPLOAD and self._settings.get_boolean(["event_on_upload_monitoring"]):
if payload.get("print", False) or self._settings.get_boolean(["event_on_upload_monitoring_always"]): # implemented in OctoPrint version 1.4.1
self._tplinksmartplug_logger.debug(
"File uploaded: %s. Turning enabled plugs on." % payload.get("name", ""))
self._tplinksmartplug_logger.debug(payload)
Expand All @@ -777,7 +777,7 @@ def on_event(self, event, payload):
if payload.get("path", False) and payload.get("target") == "local":
self._autostart_file = payload.get("path")
# Shutdown Event
if event == Events.SHUTDOWN and self._settings.getBoolean(["event_on_shutdown_monitoring"]):
if event == Events.SHUTDOWN and self._settings.get_boolean(["event_on_shutdown_monitoring"]):
for plug in self._settings.get(['arrSmartplugs']):
if plug["event_on_shutdown"] is True:
self._tplinksmartplug_logger.debug("powering off %s due to shutdown event." % plug["ip"])
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "OctoPrint-TPLinkSmartplug"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.0.2rc3"
plugin_version = "1.0.2rc4"

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

0 comments on commit 863caa3

Please sign in to comment.