From ad2c7f11ea720723aaf79af298051c2de281136f Mon Sep 17 00:00:00 2001 From: Meatballs1 Date: Tue, 19 Mar 2024 21:11:40 +0000 Subject: [PATCH] Fix flake8 requirements --- HCDevice.py | 13 ++++++++----- hc2mqtt | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/HCDevice.py b/HCDevice.py index 80ab2db..ad572e0 100755 --- a/HCDevice.py +++ b/HCDevice.py @@ -92,7 +92,7 @@ class HCDevice: return result - # Based on PR submitted https://github.com/Skons/hcpy/pull/1/files#diff-f68bc58ad15ebfcb2b6ceca7c538e00790a6093c67c7c84ebcefb0c9756d3c0eR112-R139 + # Based on PR submitted https://github.com/Skons/hcpy/pull/1 def test_program_data(self, data): if "program" not in data: raise Exception("{self.name}. Message data invalid, no program specified.") @@ -100,7 +100,7 @@ class HCDevice: if isinstance(data["program"], str): try: data["program"] = int(data["program"]) - except Exception as e: + except Exception: raise Exception( "{self.name}. Message data invalid, UID in 'program' must be an integer." ) @@ -112,7 +112,8 @@ class HCDevice: uid = str(data["program"]) if uid not in self.features: raise Exception( - f"{self.name}. Unable to configure appliance. Program UID {uid} is not valid for this device." + f"{self.name}. Unable to configure appliance. Program UID {uid} is not valid" + "for this device." ) feature = self.features[uid] @@ -121,14 +122,16 @@ class HCDevice: # May also be in the format BSH.Common.Program.Favorite.001 if ".Program." not in feature["name"]: raise Exception( - f"{self.name}. Unable to configure appliance. Program UID {uid} is not a valid program." + f"{self.name}. Unable to configure appliance. Program UID {uid} is not a valid" + "program." ) if "options" in data: for option_uid in data["options"]: if str(option_uid) not in self.features: raise Exception( - f"{self.name}. Unable to configure appliance. Option UID {uid} is not valid for this device." + f"{self.name}. Unable to configure appliance. Option UID {uid} is not" + "valid for this device." ) # Test the feature of an appliance agains a data object diff --git a/hc2mqtt b/hc2mqtt index 7d5b1ae..a6b3116 100755 --- a/hc2mqtt +++ b/hc2mqtt @@ -115,7 +115,8 @@ def client_connect(client, device, mqtt_topic): active_program = False for value in device["features"]: - # If the device has the ActiveProgram feature it allows programs to be started and scheduled via /ro/activeProgram + # If the device has the ActiveProgram feature it allows programs to be started and + # scheduled via /ro/activeProgram if "BSH.Common.Root.ActiveProgram" == device["features"][value]["name"]: active_program = True if (