From 0600e28f3047d63c91d0d20606f59fbb3ee408ab Mon Sep 17 00:00:00 2001 From: Francois JUMELLE Date: Sun, 15 Dec 2024 22:32:52 +0100 Subject: [PATCH] Remove warnings --- .gitignore | 1 + plugin.py | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 5d2da6d..a3c21b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ Domoticz.py +DomoticzEx.py parameters.properties run.py __pycache__/ diff --git a/plugin.py b/plugin.py index a6cdef5..20b419a 100755 --- a/plugin.py +++ b/plugin.py @@ -71,6 +71,7 @@ HEATZY_MODE_VALUE_INV = {v: k for k, v in HEATZY_MODE_VALUE.items()} DEFAULT_POOLING = 60 class HeatzyUnit(IntEnum): + """2 units: Control and Selector""" CONTROL = 1 SELECTOR = 2 @@ -143,7 +144,7 @@ class BasePlugin: # Get mode self.get_mode() - def on_command(self, DeviceID, Unit, Command, Level, Color): #pylint: disable=unused-argument + def on_command(self, DeviceID, Unit, Command, Level, Color): #pylint: disable=unused-argument,invalid-name """Send a command""" if Unit == HeatzyUnit.CONTROL: self.on_off(DeviceID, Command) @@ -465,15 +466,15 @@ def dump_config_to_log(): if Parameters[x] != "": Domoticz.Debug( "'" + x + "':'" + str(Parameters[x]) + "'") Domoticz.Debug("Device count: " + str(len(Devices))) - for DeviceName in Devices: - Device = Devices[DeviceName] - Domoticz.Debug("Device ID: '" + str(Device.DeviceID) + "'") - Domoticz.Debug("--->Unit Count: '" + str(len(Device.Units)) + "'") - for UnitNo in Device.Units: - Unit = Device.Units[UnitNo] - Domoticz.Debug("--->Unit: " + str(UnitNo)) - Domoticz.Debug("--->Unit Name: '" + Unit.Name + "'") - Domoticz.Debug("--->Unit nValue: " + str(Unit.nValue)) - Domoticz.Debug("--->Unit sValue: '" + Unit.sValue + "'") - Domoticz.Debug("--->Unit LastLevel: " + str(Unit.LastLevel)) + for device_name in Devices: + device = Devices[device_name] + Domoticz.Debug("Device ID: '" + str(device.DeviceID) + "'") + Domoticz.Debug("--->Unit Count: '" + str(len(device.Units)) + "'") + for unit_no in device.Units: + unit = device.Units[unit_no] + Domoticz.Debug("--->Unit: " + str(unit_no)) + Domoticz.Debug("--->Unit Name: '" + unit.Name + "'") + Domoticz.Debug("--->Unit nValue: " + str(unit.nValue)) + Domoticz.Debug("--->Unit sValue: '" + unit.sValue + "'") + Domoticz.Debug("--->Unit LastLevel: " + str(unit.LastLevel)) return