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
24 changes: 20 additions & 4 deletions pyControl4/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,30 @@ async def getFANModes(self):
"""Returns a list of supported fan modes."""
return await self.director.getItemVariableValue(self.item_id, "FAN_MODES_LIST")

async def getHoldMode(self):
"""Returns the currently active hold mode."""
return await self.director.getItemVariableValue(self.item_id, "HOLD_MODE")

async def getHoldModes(self):
"""Returns a list of supported hold modes."""
return await self.director.getItemVariableValue(self.item_id, "HOLD_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")

async def getCoolSetpointC(self):
"""Returns the cooling setpoint temperature in Celsius."""
return await self.director.getItemVariableValue(self.item_id, "COOL_SETPOINT_C")

async def getHeatSetpointF(self):
"""Returns the heating setpoint temperature in Fahrenheit."""
return await self.director.getItemVariableValue(self.item_id, "HEAT_SETPOINT_F")

async def getHeatSetpointC(self):
"""Returns the heating setpoint temperature in Celsius."""
return await self.director.getItemVariableValue(self.item_id, "HEAT_SETPOINT_C")
Expand All @@ -67,7 +75,7 @@ async def getHumidity(self):
async def getCurrentTemperatureF(self):
"""Returns the current ambient temperature in Fahrenheit."""
return await self.director.getItemVariableValue(self.item_id, "TEMPERATURE_F")

async def getCurrentTemperatureC(self):
"""Returns the current ambient temperature in Celsius."""
return await self.director.getItemVariableValue(self.item_id, "TEMPERATURE_C")
Expand Down Expand Up @@ -99,7 +107,7 @@ async def setHeatSetpointF(self, temp):
"SET_SETPOINT_HEAT",
{"FAHRENHEIT": temp},
)

async def setHeatSetpointC(self, temp):
"""Sets the heating setpoint temperature in Celsius."""
await self.director.sendPostRequest(
Expand Down Expand Up @@ -131,3 +139,11 @@ async def setPreset(self, preset):
"SET_PRESET",
{"NAME": preset},
)

async def setHoldMode(self, mode):
"""Sets the hold mode."""
await self.director.sendPostRequest(
f"/api/v1/items/{self.item_id}/commands",
"SET_MODE_HOLD",
{"MODE": mode},
)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pyControl4", # Replace with your own username
version="1.4.0",
version="1.5.0",
author="lawtancool",
author_email="[email protected]",
description="Python 3 asyncio package for interacting with Control4 systems",
Expand Down
Loading