diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fa1fe04..14d89bd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -16,10 +16,8 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 - with: - python-version: 3.8 + - name: Set up Python + uses: actions/setup-python@v5.6.0 - name: Install dependencies run: | python -m pip install --upgrade pip @@ -46,7 +44,5 @@ jobs: # Runs a single command using the runners shell - name: Black Code Formatter - uses: lgeiger/black-action@v1.0.1 - with: - args: "./pyControl4 --check --diff" + uses: psf/black@stable diff --git a/pyControl4/alarm.py b/pyControl4/alarm.py index 31b7f2e..aecb476 100644 --- a/pyControl4/alarm.py +++ b/pyControl4/alarm.py @@ -1,5 +1,4 @@ -"""Controls Control4 security panel and contact sensor (door, window, motion) devices. -""" +"""Controls Control4 security panel and contact sensor (door, window, motion) devices.""" import json from pyControl4 import C4Entity diff --git a/pyControl4/blind.py b/pyControl4/blind.py index 2f3838c..d5d73c0 100644 --- a/pyControl4/blind.py +++ b/pyControl4/blind.py @@ -1,5 +1,4 @@ -"""Controls Control4 blind devices. -""" +"""Controls Control4 blind devices.""" from pyControl4 import C4Entity diff --git a/pyControl4/climate.py b/pyControl4/climate.py index d4bdcaf..3dfae0f 100644 --- a/pyControl4/climate.py +++ b/pyControl4/climate.py @@ -10,13 +10,11 @@ class C4Climate(C4Entity): async def getHVACState(self): """Returns the current HVAC state (e.g., on/off or active mode).""" - return await self.director.getItemVariableValue(self.item_id, - "HVAC_STATE") + return await self.director.getItemVariableValue(self.item_id, "HVAC_STATE") async def getFANState(self): """Returns the current power state of the fan (True=on, False=off).""" - return await self.director.getItemVariableValue(self.item_id, - "FAN_STATE") + return await self.director.getItemVariableValue(self.item_id, "FAN_STATE") # ------------------------ # Mode Getters @@ -24,23 +22,19 @@ async def getFANState(self): async def getHVACMode(self): """Returns the currently active HVAC mode.""" - return await self.director.getItemVariableValue(self.item_id, - "HVAC_MODE") + return await self.director.getItemVariableValue(self.item_id, "HVAC_MODE") async def getHVACModes(self): """Returns a list of supported HVAC modes.""" - return await self.director.getItemVariableValue(self.item_id, - "HVAC_MODES_LIST") + return await self.director.getItemVariableValue(self.item_id, "HVAC_MODES_LIST") async def getFANMode(self): """Returns the currently active fan mode.""" - return await self.director.getItemVariableValue(self.item_id, - "FAN_MODE") + return await self.director.getItemVariableValue(self.item_id, "FAN_MODE") async def getFANModes(self): """Returns a list of supported fan modes.""" - return await self.director.getItemVariableValue(self.item_id, - "FAN_MODES_LIST") + return await self.director.getItemVariableValue(self.item_id, "FAN_MODES_LIST") # ------------------------ # Setpoint Getters @@ -48,13 +42,11 @@ async def getFANModes(self): async def getCoolSetpointF(self): """Returns the cooling setpoint temperature in Fahrenheit.""" - return await self.director.getItemVariableValue(self.item_id, - "COOL_SETPOINT_F") + return await self.director.getItemVariableValue(self.item_id, "COOL_SETPOINT_F") async def getHeatSetpointF(self): """Returns the heating setpoint temperature in Fahrenheit.""" - return await self.director.getItemVariableValue(self.item_id, - "HEAT_SETPOINT_F") + return await self.director.getItemVariableValue(self.item_id, "HEAT_SETPOINT_F") # ------------------------ # Sensor Readings @@ -62,13 +54,11 @@ async def getHeatSetpointF(self): async def getHumidity(self): """Returns the current humidity percentage.""" - return await self.director.getItemVariableValue(self.item_id, - "HUMIDITY") + return await self.director.getItemVariableValue(self.item_id, "HUMIDITY") async def getCurrentTemperature(self): """Returns the current ambient temperature in Fahrenheit.""" - return await self.director.getItemVariableValue(self.item_id, - "TEMPERATURE_F") + return await self.director.getItemVariableValue(self.item_id, "TEMPERATURE_F") # ------------------------ # Setters / Commands diff --git a/pyControl4/director.py b/pyControl4/director.py index e154413..d2bf551 100644 --- a/pyControl4/director.py +++ b/pyControl4/director.py @@ -1,5 +1,5 @@ """Handles communication with a Control4 Director, and provides functions for - getting details about items on the Director. +getting details about items on the Director. """ import aiohttp diff --git a/pyControl4/fan.py b/pyControl4/fan.py index 3915e19..462cb8e 100644 --- a/pyControl4/fan.py +++ b/pyControl4/fan.py @@ -36,8 +36,7 @@ async def getSpeed(self): Returns: int: Current fan speed (0–4). """ - value = await self.director.getItemVariableValue(self.item_id, - "CURRENT_SPEED") + value = await self.director.getItemVariableValue(self.item_id, "CURRENT_SPEED") return int(value) # ------------------------ diff --git a/pyControl4/light.py b/pyControl4/light.py index 5ab1805..93d27ef 100644 --- a/pyControl4/light.py +++ b/pyControl4/light.py @@ -1,5 +1,4 @@ -"""Controls Control4 Light devices. -""" +"""Controls Control4 Light devices.""" from pyControl4 import C4Entity diff --git a/pyControl4/relay.py b/pyControl4/relay.py index 4b656c3..8376369 100644 --- a/pyControl4/relay.py +++ b/pyControl4/relay.py @@ -1,5 +1,4 @@ -"""Controls Control4 Relay devices. These can include locks, and potentially other types of devices. -""" +"""Controls Control4 Relay devices. These can include locks, and potentially other types of devices.""" from pyControl4 import C4Entity diff --git a/pyControl4/room.py b/pyControl4/room.py index 18eb799..fcf7583 100644 --- a/pyControl4/room.py +++ b/pyControl4/room.py @@ -1,5 +1,4 @@ -"""Controls Control4 Room devices. -""" +"""Controls Control4 Room devices.""" from pyControl4 import C4Entity