Skip to content

Commit

Permalink
3.1.1
Browse files Browse the repository at this point in the history
fix issues with key errors with recent psu control changes
  • Loading branch information
jneilliii authored Nov 19, 2021
2 parents 863064a + c14238f commit 2c2cb3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions octoprint_simplyprint/comm/simplyprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,13 @@ def request(self):
if self._settings.get_boolean(["has_power_controller"]) and not self.has_checked_power_controller:
helpers = self.plugin._plugin_manager.get_helpers("psucontrol") or self.plugin._plugin_manager.get_helpers("simplypowercontroller")
if helpers:
if helpers["get_psu_state"]:
if "get_psu_state" in helpers:
status = helpers["get_psu_state"]()
if status is True:
extra += "&power_controller=on"
else:
extra += "&power_controller=off"
if helpers["get_status"]:
if "get_status" in helpers:
status = helpers["get_status"]()
if "isPSUOn" in status and status["isPSUOn"]:
extra += "&power_controller=on"
Expand Down Expand Up @@ -590,19 +590,19 @@ def process_demands(self, demand_list, response_json):
if any_demand(demand_list, ["psu_on", "psu_keepalive"]):
helpers = self.plugin._plugin_manager.get_helpers("psucontrol") or self.plugin._plugin_manager.get_helpers("simplypowercontroller")
# psucontrol plugin
if helpers and helpers["turn_psu_on"]:
if "turn_psu_on" in helpers:
helpers["turn_psu_on"]()
# simplypowercontroller plugin
if helpers and helpers["psu_on"]:
if "psu_on" in helpers:
helpers["psu_on"]()

if "psu_off" in demand_list:
helpers = self.plugin._plugin_manager.get_helpers("psucontrol") or self.plugin._plugin_manager.get_helpers("simplypowercontroller")
# psucontrol plugin
if helpers and helpers["turn_psu_off"]:
if "turn_psu_off" in helpers:
helpers["turn_psu_off"]()
# simplypowercontroller plugin
if helpers and helpers["psu_off"]:
if "psu_off" in helpers:
helpers["psu_off"]()
pass

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 @@

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
# Remember to bump the version in octoprint_simplyprint/__init__.py as well
plugin_version = "3.1.0"
plugin_version = "3.1.1"

# 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 2c2cb3b

Please sign in to comment.