From eb1fcdf9d0c633ce6785ca9cd597958479321f7f Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 16 Jul 2020 18:44:02 -0400 Subject: [PATCH] Python 3.x Compatibility. Fixes #15 --- octoprint_fanspeedslider/__init__.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) mode change 100644 => 100755 octoprint_fanspeedslider/__init__.py diff --git a/octoprint_fanspeedslider/__init__.py b/octoprint_fanspeedslider/__init__.py old mode 100644 new mode 100755 index e921d53..4ee8f69 --- a/octoprint_fanspeedslider/__init__.py +++ b/octoprint_fanspeedslider/__init__.py @@ -31,19 +31,19 @@ class FanSliderPlugin(octoprint.plugin.StartupPlugin, def on_settings_save(self, data): s = self._settings - if "defaultFanSpeed" in data.keys(): + if "defaultFanSpeed" in list(data.keys()): s.setInt(["defaultFanSpeed"], data["defaultFanSpeed"]) - if "minSpeed" in data.keys(): + if "minSpeed" in list(data.keys()): s.setInt(["minSpeed"], data["minSpeed"]) - if "maxSpeed" in data.keys(): + if "maxSpeed" in list(data.keys()): s.setInt(["maxSpeed"], data["maxSpeed"]) - if "notifyDelay" in data.keys(): + if "notifyDelay" in list(data.keys()): s.setInt(["notifyDelay"], data["notifyDelay"]) - if "lockfan" in data.keys(): + if "lockfan" in list(data.keys()): s.set(["lockfan"], data["lockfan"]) - if "lastSentSpeed" in data.keys(): + if "lastSentSpeed" in list(data.keys()): s.setInt(["lastSentSpeed"], data["lastSentSpeed"]) - if "defaultLastSpeed" in data.keys(): + if "defaultLastSpeed" in list(data.keys()): s.set(["defaultLastSpeed"], data["defaultLastSpeed"]) self.get_settings_updates() #clean up settings if everything's default @@ -131,6 +131,7 @@ class FanSliderPlugin(octoprint.plugin.StartupPlugin, ) __plugin_name__ = "Fan Speed Control" +__plugin_pythoncompat__ = ">=2.7,<4" def __plugin_load__(): global __plugin_implementation__