Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make more standard set comfocollmode #27

Merged
merged 1 commit into from
May 4, 2024
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
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"