Skip to content

Commit

Permalink
Make more standard set comfocollmode (michaelarnauts#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
szibis authored May 4, 2024
1 parent bd27eeb commit a07a4b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aiocomfoconnect/comfoconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
VentilationSetting,
VentilationSpeed,
VentilationTemperatureProfile,
ComfoCoolMode,
)
from aiocomfoconnect.exceptions import (
AioComfoConnectNotConnected,
Expand Down Expand Up @@ -397,9 +398,9 @@ async def get_comfocool_mode(self):

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

async def get_temperature_profile(self):
Expand Down
6 changes: 6 additions & 0 deletions aiocomfoconnect/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,9 @@ class VentilationSpeed:
LOW = "low"
MEDIUM = "medium"
HIGH = "high"

class ComfoCoolMode:
"""Enum for ventilation settings."""

AUTO = "auto"
OFF = "off"

0 comments on commit a07a4b9

Please sign in to comment.