Skip to content

Commit a07a4b9

Browse files
authored
Make more standard set comfocollmode (#27)
1 parent bd27eeb commit a07a4b9

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

aiocomfoconnect/comfoconnect.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
VentilationSetting,
2828
VentilationSpeed,
2929
VentilationTemperatureProfile,
30+
ComfoCoolMode,
3031
)
3132
from aiocomfoconnect.exceptions import (
3233
AioComfoConnectNotConnected,
@@ -397,9 +398,9 @@ async def get_comfocool_mode(self):
397398

398399
async def set_comfocool_mode(self, mode: Literal["auto", "off"], timeout=-1):
399400
"""Set the comfocool mode (auto / off)."""
400-
if mode == "auto":
401+
if mode == ComfoCoolMode.AUTO:
401402
await self.cmd_rmi_request(bytes([0x85, UNIT_SCHEDULE, SUBUNIT_05, 0x01]))
402-
else:
403+
elif mode == ComfoCoolMode.OFF:
403404
await self.cmd_rmi_request(bytestring([0x84, UNIT_SCHEDULE, SUBUNIT_05, 0x01, 0x00, 0x00, 0x00, 0x00, timeout.to_bytes(4, "little", signed=True), 0x00]))
404405

405406
async def get_temperature_profile(self):

aiocomfoconnect/const.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,9 @@ class VentilationSpeed:
207207
LOW = "low"
208208
MEDIUM = "medium"
209209
HIGH = "high"
210+
211+
class ComfoCoolMode:
212+
"""Enum for ventilation settings."""
213+
214+
AUTO = "auto"
215+
OFF = "off"

0 commit comments

Comments
 (0)