Skip to content

Commit a7ec36a

Browse files
committed
Constant allowed zone profiles
1 parent cbbdeda commit a7ec36a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

plugwise/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
VOLUME_CUBIC_METERS_PER_HOUR: Final = "m³/h"
3434

3535
ADAM: Final = "Adam"
36+
ALLOWED_ZONE_PROFILES: Final(set) = ("active", "off", "passive")
3637
ANNA: Final = "Smile Anna"
3738
ANNA_P1: Final = "Smile Anna P1"
3839
DEFAULT_TIMEOUT: Final = 10

plugwise/smile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from plugwise.constants import (
1313
ADAM,
14+
ALLOWED_ZONE_PROFILES,
1415
ANNA,
1516
APPLIANCES,
1617
DOMAIN_OBJECTS,
@@ -308,7 +309,7 @@ async def set_regulation_mode(self, mode: str) -> None:
308309

309310
async def set_zone_profile(self, profile: str) -> None:
310311
"""Set the Adam thermoszone heating profile."""
311-
if profile not in ("active", "off", "passive"):
312+
if profile not in ALLOWED_ZONE_PROFILES:
312313
raise PlugwiseError("Plugwise: invalid zone profile.")
313314

314315
data = (

0 commit comments

Comments
 (0)