Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -46,7 +44,5 @@ jobs:

# Runs a single command using the runners shell
- name: Black Code Formatter
uses: lgeiger/[email protected]
with:
args: "./pyControl4 --check --diff"
uses: psf/black@stable

3 changes: 1 addition & 2 deletions pyControl4/alarm.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions pyControl4/blind.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Controls Control4 blind devices.
"""
"""Controls Control4 blind devices."""

from pyControl4 import C4Entity

Expand Down
30 changes: 10 additions & 20 deletions pyControl4/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,65 +10,55 @@ 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
# ------------------------

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

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

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
Expand Down
2 changes: 1 addition & 1 deletion pyControl4/director.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions pyControl4/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

# ------------------------
Expand Down
3 changes: 1 addition & 2 deletions pyControl4/light.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Controls Control4 Light devices.
"""
"""Controls Control4 Light devices."""

from pyControl4 import C4Entity

Expand Down
3 changes: 1 addition & 2 deletions pyControl4/relay.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 1 addition & 2 deletions pyControl4/room.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Controls Control4 Room devices.
"""
"""Controls Control4 Room devices."""

from pyControl4 import C4Entity

Expand Down
Loading