diff --git a/pyproject.toml b/pyproject.toml index c400017..39515c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "xcomfort" -version = "0.4.1" +version = "0.4.2" description = "Integration with Eaton xComfort Bridge" readme = "README.md" license = {text = "MIT"} @@ -18,7 +18,6 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -26,7 +25,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", ] -requires-python = ">=3.7" +requires-python = ">=3.8" dependencies = [ "aiohttp", "rx", diff --git a/xcomfort/constants.py b/xcomfort/constants.py index 2726446..2a8457e 100644 --- a/xcomfort/constants.py +++ b/xcomfort/constants.py @@ -151,18 +151,22 @@ class HeatingTypes(IntEnum): class ComponentTypes(IntEnum): """Component types for xComfort devices.""" - PUSH_BUTTON_1 = 1 - PUSH_BUTTON_2 = 2 + PUSH_BUTTON_1_CHANNEL = 1 + PUSH_BUTTON_2_CHANNEL = 2 + PUSH_BUTTON_4_CHANNEL = 3 MULTI_HEATING_ACTUATOR = 71 LIGHT_SWITCH_ACTUATOR = 74 DOOR_WINDOW_SENSOR = 76 DIMMING_ACTUATOR = 77 RC_TOUCH = 78 + HEATING_ACTUATOR_1_CHANNEL = 81 BRIDGE = 83 WATER_GUARD = 84 WATER_SENSOR = 85 SHADING_ACTUATOR = 86 - MULTI_SENSOR_PUSH_BUTTON_1 = 87 + PUSH_BUTTON_MULTI_SENSOR_1_CHANNEL = 87 + PUSH_BUTTON_MULTI_SENSOR_2_CHANNEL = 88 + PUSH_BUTTON_MULTI_SENSOR_4_CHANNEL = 89 # Firmware build version mappings diff --git a/xcomfort/devices.py b/xcomfort/devices.py index 3604422..2ea2d6d 100644 --- a/xcomfort/devices.py +++ b/xcomfort/devices.py @@ -4,7 +4,7 @@ import rx -from .constants import Messages, ShadeOperationState +from .constants import ComponentTypes, Messages, ShadeOperationState _LOGGER = logging.getLogger(__name__) @@ -351,7 +351,11 @@ def __init__(self, bridge, device_id, name, comp_id, payload): # Subscribe to component state updates if this is a multisensor comp = bridge._comps.get(comp_id) # noqa: SLF001 - if comp is not None and comp.comp_type == 87: + if comp is not None and comp.comp_type in ( + ComponentTypes.PUSH_BUTTON_MULTI_SENSOR_1_CHANNEL, + ComponentTypes.PUSH_BUTTON_MULTI_SENSOR_2_CHANNEL, + ComponentTypes.PUSH_BUTTON_MULTI_SENSOR_4_CHANNEL, + ): comp.state.subscribe(lambda _: self._on_component_update()) # Find and subscribe to companion sensor device self._find_and_subscribe_sensor_device() @@ -371,8 +375,12 @@ def name_with_controlled(self) -> str: def has_sensors(self) -> bool: """Check if this rocker has sensor capabilities.""" comp = self.bridge._comps.get(self.comp_id) # noqa: SLF001 - # Component type 87 is MULTI_SENSOR_PUSH_BUTTON_1 - return comp is not None and comp.comp_type == 87 + # Check if component is any multi sensor push button type + return comp is not None and comp.comp_type in ( + ComponentTypes.PUSH_BUTTON_MULTI_SENSOR_1_CHANNEL, + ComponentTypes.PUSH_BUTTON_MULTI_SENSOR_2_CHANNEL, + ComponentTypes.PUSH_BUTTON_MULTI_SENSOR_4_CHANNEL, + ) def _find_and_subscribe_sensor_device(self) -> None: """Find companion sensor device and subscribe to its updates.