Repository: maeek/ha-aux-cloud
Pull request #22: Fix case when special params task was None
Author: login: maeek
Created: 2025-04-21T18:54:10Z | Merged: 2025-04-23T19:09:12Z

- Fixes case when special params task was None (#19)

Still needs some re-work to add another device type


Diff:
diff --git a/custom_components/aux_cloud/__init__.py b/custom_components/aux_cloud/__init__.py
index 9976afa..e600775 100644
--- a/custom_components/aux_cloud/__init__.py
+++ b/custom_components/aux_cloud/__init__.py
@@ -91,7 +91,6 @@ def __init__(
         self.password = password
         self.selected_device_ids = selected_device_ids
         self.devices = []
-        _LOGGER.debug("AUX Cloud Coordinator initialized with email: %s", email)
 
     def get_device_by_endpoint_id(self, endpoint_id: str):
         """Get a device by its endpoint ID."""
@@ -122,7 +121,6 @@ async def _async_update_data(self):
 
             # Create a single list of tasks for fetching devices (shared and non-shared)
             device_tasks = []
-            shared_device_tasks = []
 
             for family_id in self.api.families:
                 device_tasks.append(
@@ -132,7 +130,7 @@ async def _async_update_data(self):
                         selected_devices=self.selected_device_ids,
                     )
                 )
-                shared_device_tasks.append(
+                device_tasks.append(
                     self.api.get_devices(
                         family_id,
                         shared=True,
@@ -144,28 +142,21 @@ async def _async_update_data(self):
             devices_results = await asyncio.gather(
                 *device_tasks, return_exceptions=True
             )
-            shared_devices_results = await asyncio.gather(
-                *shared_device_tasks, return_exceptions=True
-            )
 
             # Process results and handle exceptions
             all_devices = []
 
-            for result in devices_results + shared_devices_results:
+            for result in devices_results:
                 for device in result:
                     if isinstance(device, Exception):
                         continue
-                    all_devices.append(device)
-            # Filter devices if selected_device_ids is provided
-            if self.selected_device_ids:
-                self.devices = [
-                    device
-                    for device in all_devices
-                    if device["endpointId"] in self.selected_device_ids
-                ]
-            else:
-                self.devices = all_devices
+                    if (
+                        device["endpointId"] in self.selected_device_ids
+                        or not self.selected_device_ids
+                    ):
+                        all_devices.append(device)
 
+            self.devices = all_devices
             _LOGGER.debug("Fetched AUX Cloud data: %s devices", len(self.devices))
 
             self.async_set_updated_data({"devices": self.devices})
diff --git a/custom_components/aux_cloud/api/aux_cloud.py b/custom_components/aux_cloud/api/aux_cloud.py
index bd68809..47a1409 100644
--- a/custom_components/aux_cloud/api/aux_cloud.py
+++ b/custom_components/aux_cloud/api/aux_cloud.py
@@ -8,7 +8,7 @@
 
 import aiohttp
 
-from .const import AUX_MODEL_SPECIAL_PARAMS_LIST
+from .const import AuxProducts
 from .util import encrypt_aes_cbc_zero_padding
 from .aux_cloud_ws import AuxCloudWebSocket
 
@@ -78,13 +78,12 @@ class AuxCloudAPI:
     """
 
     def __init__(self, region: str = "eu"):
-        self.url = (
-            API_SERVER_URL_EU
-            if region == "eu"
-            else API_SERVER_URL_USA if region == "usa" else API_SERVER_URL_CN
-        )
+        self.url = {
+            "eu": API_SERVER_URL_EU,
+            "usa": API_SERVER_URL_USA,
+            "cn": API_SERVER_URL_CN,
+        }.get(region, API_SERVER_URL_EU)
         self.region = region
-        self.devices = None
         self.families = None
         self.email = None
         self.password = None
@@ -123,7 +122,6 @@ async def _make_request(
         """
         url = f"{self.url}/{endpoint}"
 
-        _LOGGER.debug("Region: %s", self.url)
         _LOGGER.debug("Making %s request to %s", method, endpoint)
         async with aiohttp.ClientSession() as session:
             async with session.request(
@@ -279,13 +277,11 @@ async def get_devices(
         )
 
         if "status" in json_data and json_data["status"] == 0:
-            self.devices = []
-            devices = []  # Initialize with empty list
+            devices = []
 
             if "endpoints" in json_data["data"]:
                 devices = json_data["data"]["endpoints"] or []
             elif "shareFromOther" in json_data["data"]:
-                # _LOGGER.info(f"Shared devices found: {json_data['data']}")
                 devices = list(
                     map(lambda dev: dev["devinfo"], json_data["data"]["shareFromOther"])
                 )
@@ -311,9 +307,6 @@ async def get_devices(
                     ),
                     0,
                 )
-                _LOGGER.debug(
-                    "Device states response %s: %s", dev["endpointId"], dev["state"]
-                )
                 # Initialize params as an empty dictionary
                 dev["params"] = {}
 
@@ -323,21 +316,21 @@ async def get_devices(
                     "online" if dev["state"] == 1 else "offline",
                     dev,
                 )
-                self.devices.append(dev)
 
                 # Create tasks for fetching device params
-                dev_params_task = self.get_device_params(dev, params=list([]))
+                dev_params_task = asyncio.create_task(
+                    self.get_device_params(dev, params=list([]))
+                )
                 dev_special_params_task = None
 
-                if dev["productId"] in AUX_MODEL_SPECIAL_PARAMS_LIST:
-                    _LOGGER.debug(
-                        "Fetching special params for device %s: %s",
-                        dev["productId"],
-                        AUX_MODEL_SPECIAL_PARAMS_LIST[dev["productId"]],
-                    )
-                    dev_special_params_task = self.get_device_params(
-                        dev,
-                        params=list(AUX_MODEL_SPECIAL_PARAMS_LIST[dev["productId"]]),
+                if AuxProducts.get_special_params_list(dev["productId"]) is not None:
+                    dev_special_params_task = asyncio.create_task(
+                        self.get_device_params(
+                            dev,
+                            params=AuxProducts.get_special_params_list(
+                                dev["productId"]
+                            ),
+                        )
                     )
 
                 # Add tasks to the list
@@ -347,7 +340,9 @@ async def get_devices(
             results = await asyncio.gather(
                 *[
                     asyncio.gather(
-                        dev_params_task, dev_special_params_task, return_exceptions=True
+                        dev_params_task,
+                        *(dev_special_params_task,) if dev_special_params_task else (),
+                        return_exceptions=True,
                     )
                     for _, dev_params_task, dev_special_params_task in param_tasks
                 ],
@@ -355,15 +350,13 @@ async def get_devices(
             )
 
             # Process the results
-            for (dev, _, _), (dev_params, dev_special_params) in zip(
-                param_tasks, results
+            for i, (dev, dev_params_task, dev_special_params_task) in enumerate(
+                param_tasks
             ):
-                if (
-                    dev_params is None
-                    or dev_special_params is None
-                    or isinstance(dev_params, BaseException)
-                    or isinstance(dev_special_params, BaseException)
-                ):
+                dev_params = results[i][0]
+                dev_special_params = results[i][1] if len(results[i]) > 1 else None
+
+                if dev_params is None or isinstance(dev_params, BaseException):
                     _LOGGER.error(
                         "Error fetching device params for %s",
                         dev["endpointId"],
@@ -375,17 +368,11 @@ async def get_devices(
                 if dev_special_params:
                     dev["params"].update(dev_special_params)
 
-                # Update the device entry in the list
-                self.devices = [
-                    d for d in self.devices if d["endpointId"] != dev["endpointId"]
-                ]
-
                 dev["last_updated"] = time.strftime(
                     "%Y-%m-%d %H:%M:%S", time.localtime()
                 )
-                self.devices.append(dev)
 
-            return self.devices
+            return devices
 
         raise AuxApiError(f"Failed to query devices: {json_data}")
 
diff --git a/custom_components/aux_cloud/api/const.py b/custom_components/aux_cloud/api/const.py
index f4584d4..3c14bfa 100644
--- a/custom_components/aux_cloud/api/const.py
+++ b/custom_components/aux_cloud/api/const.py
@@ -1,19 +1,5 @@
 from enum import auto
 
-AUX_MODEL_TO_NAME = {
-    "000000000000000000000000c3aa0000": "AUX Heat Pump",
-    "000000000000000000000000c0620000": "AUX Air Conditioner",
-}
-
-AC = "Air Conditioner"
-HEAT_PUMP = "Heat Pump"
-
-
-class AuxProductCategory(auto):
-    HEAT_PUMP = ["000000000000000000000000c3aa0000"]
-
-    AC = ["000000000000000000000000c0620000"]
-
 
 # Common constants
 AUX_MODE = "ac_mode"
@@ -135,21 +121,24 @@ class ACFanSpeed(auto):
 HP_WATER_FAST_HOTWATER_OFF = {HP_WATER_FAST_HOTWATER: 0}
 
 
-AUX_MODEL_PARAMS_LIST = {
-    "000000000000000000000000c3aa0000": [
-        "ac_errcode1",
-        AUX_MODE,
-        HP_HEATER_POWER,
-        HP_HEATER_TEMPERATURE_TARGET,
-        AUX_ECOMODE,
-        AUX_ERROR_FLAG,
-        HP_HEATER_AUTO_WATER_TEMP,
-        HP_WATER_FAST_HOTWATER,
-        HP_HOT_WATER_TEMPERATURE_TARGET,
-        HP_WATER_POWER,
-        HP_QUIET_MODE,
-    ],
-    "000000000000000000000000c0620000": [
+class AuxProducts:
+    class DeviceType:
+        AC_GENERIC = [
+            "000000000000000000000000c0620000",
+            "0000000000000000000000002a4e0000",
+        ]
+
+        HEAT_PUMP = ["000000000000000000000000c3aa0000"]
+
+    @staticmethod
+    def get_device_name(product_id):
+        if product_id in AuxProducts.DeviceType.AC_GENERIC:
+            return "AUX Air Conditioner"
+        elif AuxProducts.DeviceType.HEAT_PUMP:
+            return "AUX Heat Pump"
+        return "Unknown"
+
+    AC_PARAMS = [
         AC_AUXILIARY_HEAT,
         AC_CLEAN,
         AC_SWING_HORIZONTAL,
@@ -175,14 +164,43 @@ class ACFanSpeed(auto):
         "ac_errcode1",
         "tempunit",
         "tenelec",  # Unknown, might be available when the device is in specific state
-    ],
-}
-
-# Used to fetch params from the device that are not returned in basic call
-AUX_MODEL_SPECIAL_PARAMS_LIST = {
-    "000000000000000000000000c3aa0000": [HP_HOT_WATER_TANK_TEMPERATURE],
-    "000000000000000000000000c0620000": [AC_MODE_SPECIAL],
-}
+    ]
+
+    AC_SPECIAL_PARAMS = [AC_MODE_SPECIAL]
+
+    HP_PARAMS = [
+        "ac_errcode1",
+        AUX_MODE,
+        HP_HEATER_POWER,
+        HP_HEATER_TEMPERATURE_TARGET,
+        AUX_ECOMODE,
+        AUX_ERROR_FLAG,
+        HP_HEATER_AUTO_WATER_TEMP,
+        HP_WATER_FAST_HOTWATER,
+        HP_HOT_WATER_TEMPERATURE_TARGET,
+        HP_WATER_POWER,
+        HP_QUIET_MODE,
+    ]
+
+    HP_SPECIAL_PARAMS = [HP_HOT_WATER_TANK_TEMPERATURE]
+
+    @staticmethod
+    def get_params_list(product_id):
+        if product_id in AuxProducts.DeviceType.AC_GENERIC:
+            return AuxProducts.AC_PARAMS
+        elif product_id in AuxProducts.DeviceType.HEAT_PUMP:
+            return AuxProducts.HP_PARAMS
+        else:
+            return None
+
+    @staticmethod
+    def get_special_params_list(product_id):
+        if product_id in AuxProducts.DeviceType.AC_GENERIC:
+            return AuxProducts.AC_SPECIAL_PARAMS
+        elif product_id in AuxProducts.DeviceType.HEAT_PUMP:
+            return AuxProducts.HP_SPECIAL_PARAMS
+        else:
+            return None
 
 
 """
diff --git a/custom_components/aux_cloud/climate.py b/custom_components/aux_cloud/climate.py
index 526af8e..f91070b 100644
--- a/custom_components/aux_cloud/climate.py
+++ b/custom_components/aux_cloud/climate.py
@@ -35,7 +35,7 @@
     AC_TEMPERATURE_TARGET,
     HP_MODE_COOLING,
     HP_MODE_HEATING,
-    AuxProductCategory,
+    AuxProducts,
     AUX_ECOMODE_OFF,
     AUX_ECOMODE_ON,
     HP_HEATER_TEMPERATURE_TARGET,
@@ -72,7 +72,7 @@ async def async_setup_entry(
 
     # Create climate entities for each device
     for device in coordinator.data["devices"]:
-        if device.get("productId") in AuxProductCategory.AC:
+        if device.get("productId") in AuxProducts.DeviceType.AC_GENERIC:
             entities.append(
                 AuxACClimateEntity(
                     coordinator,
@@ -86,7 +86,7 @@ async def async_setup_entry(
                     ),
                 )
             )
-        elif device.get("productId") in AuxProductCategory.HEAT_PUMP:
+        elif device.get("productId") in AuxProducts.DeviceType.HEAT_PUMP:
             entities.append(
                 AuxHeatPumpClimateEntity(
                     coordinator,
diff --git a/custom_components/aux_cloud/number.py b/custom_components/aux_cloud/number.py
index 1f2c998..68ddb7f 100644
--- a/custom_components/aux_cloud/number.py
+++ b/custom_components/aux_cloud/number.py
@@ -6,8 +6,7 @@
 
 from .api.const import (
     AC_POWER_LIMIT,
-    AUX_MODEL_PARAMS_LIST,
-    AUX_MODEL_SPECIAL_PARAMS_LIST,
+    AuxProducts,
 )
 from .util import BaseEntity
 from .const import DOMAIN, _LOGGER
@@ -39,33 +38,33 @@ async def async_setup_entry(
     entities = []
 
     for device in coordinator.data["devices"]:
-        for number in NUMBERS.values():
+        supported_params = AuxProducts.get_params_list(device["productId"])
+        supported_special_params = AuxProducts.get_special_params_list(
+            device["productId"]
+        )
+
+        for entity in NUMBERS.values():
             if "productId" in device and (
-                (
-                    device["productId"] in AUX_MODEL_PARAMS_LIST
-                    and number["description"].key
-                    in AUX_MODEL_PARAMS_LIST.get(device["productId"])
-                )
+                (supported_params and entity["description"].key in supported_params)
                 or (
-                    device["productId"] in AUX_MODEL_SPECIAL_PARAMS_LIST
-                    and number["description"].key
-                    in AUX_MODEL_SPECIAL_PARAMS_LIST.get(device["productId"])
+                    supported_special_params
+                    and entity["description"].key in supported_special_params
                 )
             ):
                 entities.append(
                     AuxNumberEntity(
                         coordinator,
                         device["endpointId"],
-                        number["description"],
-                        number["min_value"],
-                        number["max_value"],
-                        number["step"],
+                        entity["description"],
+                        entity["min_value"],
+                        entity["max_value"],
+                        entity["step"],
                     )
                 )
                 _LOGGER.debug(
                     "Adding number entity for %s with option %s",
                     device["friendlyName"],
-                    number["description"].key,
+                    entity["description"].key,
                 )
 
     if entities:
diff --git a/custom_components/aux_cloud/select.py b/custom_components/aux_cloud/select.py
index 0cb93b8..75dfdcc 100644
--- a/custom_components/aux_cloud/select.py
+++ b/custom_components/aux_cloud/select.py
@@ -7,8 +7,7 @@
 from homeassistant.helpers.update_coordinator import CoordinatorEntity
 
 from .api.const import (
-    AUX_MODEL_PARAMS_LIST,
-    AUX_MODEL_SPECIAL_PARAMS_LIST,
+    AuxProducts,
     HP_HEATER_AUTO_WATER_TEMP,
     HP_QUIET_MODE,
 )
@@ -104,17 +103,17 @@ async def async_setup_entry(
 
     # Create select entities for each device
     for device in coordinator.data["devices"]:
+        supported_params = AuxProducts.get_params_list(device["productId"])
+        supported_special_params = AuxProducts.get_special_params_list(
+            device["productId"]
+        )
+
         for entity in SELECTS.values():
             if "productId" in device and (
-                (
-                    device["productId"] in AUX_MODEL_PARAMS_LIST
-                    and entity["description"].key
-                    in AUX_MODEL_PARAMS_LIST.get(device["productId"])
-                )
+                (supported_params and entity["description"].key in supported_params)
                 or (
-                    device["productId"] in AUX_MODEL_SPECIAL_PARAMS_LIST
-                    and entity["description"].key
-                    in AUX_MODEL_SPECIAL_PARAMS_LIST.get(device["productId"])
+                    supported_special_params
+                    and entity["description"].key in supported_special_params
                 )
             ):
                 entities.append(
diff --git a/custom_components/aux_cloud/sensor.py b/custom_components/aux_cloud/sensor.py
index 37bfc23..0b32b3c 100644
--- a/custom_components/aux_cloud/sensor.py
+++ b/custom_components/aux_cloud/sensor.py
@@ -13,8 +13,7 @@
     AC_TEMPERATURE_AMBIENT,
     AC_TEMPERATURE_TARGET,
     AUX_ERROR_FLAG,
-    AUX_MODEL_PARAMS_LIST,
-    AUX_MODEL_SPECIAL_PARAMS_LIST,
+    AuxProducts,
     HP_HOT_WATER_TANK_TEMPERATURE,
     HP_HOT_WATER_TEMPERATURE_TARGET,
     HP_HEATER_TEMPERATURE_TARGET,
@@ -118,17 +117,17 @@ async def async_setup_entry(
 
     _LOGGER.debug("Setting up AUX Cloud sensors %s", coordinator.data["devices"])
     for device in coordinator.data["devices"]:
+        supported_params = AuxProducts.get_params_list(device["productId"])
+        supported_special_params = AuxProducts.get_special_params_list(
+            device["productId"]
+        )
+
         for entity in SENSORS.values():
             if "productId" in device and (
-                (
-                    device["productId"] in AUX_MODEL_PARAMS_LIST
-                    and entity["param"]
-                    in AUX_MODEL_PARAMS_LIST.get(device["productId"])
-                )
+                (supported_params and entity["description"].key in supported_params)
                 or (
-                    device["productId"] in AUX_MODEL_SPECIAL_PARAMS_LIST
-                    and entity["param"]
-                    in AUX_MODEL_SPECIAL_PARAMS_LIST.get(device["productId"])
+                    supported_special_params
+                    and entity["description"].key in supported_special_params
                 )
             ):
                 sensor = AuxCloudSensor(
diff --git a/custom_components/aux_cloud/switch.py b/custom_components/aux_cloud/switch.py
index 8ac5546..878ae84 100644
--- a/custom_components/aux_cloud/switch.py
+++ b/custom_components/aux_cloud/switch.py
@@ -16,8 +16,7 @@
     AC_SCREEN_DISPLAY,
     AC_SLEEP,
     AUX_ECOMODE,
-    AUX_MODEL_PARAMS_LIST,
-    AUX_MODEL_SPECIAL_PARAMS_LIST,
+    AuxProducts,
     HP_HEATER_POWER,
     HP_WATER_FAST_HOTWATER,
     HP_WATER_POWER,
@@ -153,27 +152,27 @@ async def async_setup_entry(
     entities = []
 
     for device in coordinator.data["devices"]:
-        for switch in SWITCHES.values():
+        supported_params = AuxProducts.get_params_list(device["productId"])
+        supported_special_params = AuxProducts.get_special_params_list(
+            device["productId"]
+        )
+
+        for entity in SWITCHES.values():
             if "productId" in device and (
-                (
-                    device["productId"] in AUX_MODEL_PARAMS_LIST
-                    and switch["description"].key
-                    in AUX_MODEL_PARAMS_LIST.get(device["productId"])
-                )
+                (supported_params and entity["description"].key in supported_params)
                 or (
-                    device["productId"] in AUX_MODEL_SPECIAL_PARAMS_LIST
-                    and switch["description"].key
-                    in AUX_MODEL_SPECIAL_PARAMS_LIST.get(device["productId"])
+                    supported_special_params
+                    and entity["description"].key in supported_special_params
                 )
             ):
                 entities.append(
                     AuxSwitchEntity(
                         coordinator,
                         device["endpointId"],
-                        switch["description"],
+                        entity["description"],
                         (
-                            switch["custom_mapping"]
-                            if "custom_mapping" in switch
+                            entity["custom_mapping"]
+                            if "custom_mapping" in entity
                             else None
                         ),
                     )
@@ -181,7 +180,7 @@ async def async_setup_entry(
                 _LOGGER.debug(
                     "Adding switch entity for %s with option %s",
                     device["friendlyName"],
-                    switch["description"].key,
+                    entity["description"].key,
                 )
 
     if entities:
diff --git a/custom_components/aux_cloud/util.py b/custom_components/aux_cloud/util.py
index 044bf74..f25ecbb 100644
--- a/custom_components/aux_cloud/util.py
+++ b/custom_components/aux_cloud/util.py
@@ -2,7 +2,7 @@
 from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
 from homeassistant.helpers.update_coordinator import CoordinatorEntity
 
-from .api.const import AUX_MODEL_TO_NAME
+from .api.const import AuxProducts
 from .const import _LOGGER, DOMAIN, MANUFACTURER
 
 
@@ -35,7 +35,7 @@ def device_info(self):
             identifiers={(DOMAIN, self._device_id)},
             name=self._device.get("friendlyName", "AUX"),
             manufacturer=MANUFACTURER,
-            model=AUX_MODEL_TO_NAME.get(self._device.get("productId", None), "Unknown"),
+            model=AuxProducts.get_device_name(self._device.get("productId", None)),
         )
 
     @property
diff --git a/custom_components/aux_cloud/water_heater.py b/custom_components/aux_cloud/water_heater.py
index c9c9a9f..fe1559d 100644
--- a/custom_components/aux_cloud/water_heater.py
+++ b/custom_components/aux_cloud/water_heater.py
@@ -13,7 +13,7 @@
 from homeassistant.helpers.update_coordinator import CoordinatorEntity
 
 from .api.const import (
-    AuxProductCategory,
+    AuxProducts,
     AUX_ECOMODE,
     HP_HOT_WATER_TANK_TEMPERATURE,
     HP_HOT_WATER_TEMPERATURE_TARGET,
@@ -55,7 +55,7 @@ async def async_setup_entry(
     for device in coordinator.data["devices"]:
         for entity in WATER_HEATER_ENTITIES.values():
             # Only add water heater entities for devices that are in the AUX "Heat pump" category
-            if device["productId"] in AuxProductCategory.HEAT_PUMP:
+            if device["productId"] in AuxProducts.DeviceType.HEAT_PUMP:
                 entities.append(
                     AuxWaterHeaterEntity(
                         coordinator,


Reviews:
user: login: maczet
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-23T09:47:56Z

Review comments:
diff_hunk: @@ -78,13 +78,12 @@ class AuxCloudAPI:
     """
 
     def __init__(self, region: str = "eu"):
-        self.url = (
-            API_SERVER_URL_EU
-            if region == "eu"
-            else API_SERVER_URL_USA if region == "usa" else API_SERVER_URL_CN
-        )
+        self.url = {
path: custom_components/aux_cloud/api/aux_cloud.py
user: login: maczet
body: looks better.
created_at: 2025-04-23T09:42:22Z
author_association: COLLABORATOR
diff_hunk: @@ -135,21 +121,24 @@ class ACFanSpeed(auto):
 HP_WATER_FAST_HOTWATER_OFF = {HP_WATER_FAST_HOTWATER: 0}
 
 
-AUX_MODEL_PARAMS_LIST = {
-    "000000000000000000000000c3aa0000": [
-        "ac_errcode1",
-        AUX_MODE,
-        HP_HEATER_POWER,
-        HP_HEATER_TEMPERATURE_TARGET,
-        AUX_ECOMODE,
-        AUX_ERROR_FLAG,
-        HP_HEATER_AUTO_WATER_TEMP,
-        HP_WATER_FAST_HOTWATER,
-        HP_HOT_WATER_TEMPERATURE_TARGET,
-        HP_WATER_POWER,
-        HP_QUIET_MODE,
-    ],
-    "000000000000000000000000c0620000": [
+class AuxProducts:
+    class DeviceType:
+        AC_GENERIC = [
path: custom_components/aux_cloud/api/const.py
user: login: maczet
body: This is good idea. But in readme, we can add information devices that were tested.
created_at: 2025-04-23T09:44:55Z
author_association: COLLABORATOR
diff_hunk: @@ -135,21 +121,24 @@ class ACFanSpeed(auto):
 HP_WATER_FAST_HOTWATER_OFF = {HP_WATER_FAST_HOTWATER: 0}
 
 
-AUX_MODEL_PARAMS_LIST = {
-    "000000000000000000000000c3aa0000": [
-        "ac_errcode1",
-        AUX_MODE,
-        HP_HEATER_POWER,
-        HP_HEATER_TEMPERATURE_TARGET,
-        AUX_ECOMODE,
-        AUX_ERROR_FLAG,
-        HP_HEATER_AUTO_WATER_TEMP,
-        HP_WATER_FAST_HOTWATER,
-        HP_HOT_WATER_TEMPERATURE_TARGET,
-        HP_WATER_POWER,
-        HP_QUIET_MODE,
-    ],
-    "000000000000000000000000c0620000": [
+class AuxProducts:
+    class DeviceType:
+        AC_GENERIC = [
+            "000000000000000000000000c0620000",
+            "0000000000000000000000002a4e0000",
+        ]
+
+        HEAT_PUMP = ["000000000000000000000000c3aa0000"]
+
+    @staticmethod
+    def get_device_name(product_id):
+        if product_id in AuxProducts.DeviceType.AC_GENERIC:
+            return "AUX Air Conditioner"
+        elif AuxProducts.DeviceType.HEAT_PUMP:
+            return "AUX Heat Pump"
+        return "Unknown"
+
+    AC_PARAMS = [
path: custom_components/aux_cloud/api/const.py
user: login: maczet
body: One think what can be refactored in the future it that I see parameter in HA not supported by AC or not supported by AC freedom application
created_at: 2025-04-23T09:47:38Z
author_association: COLLABORATOR

PR comments:
user: login: maczet
created_at: 2025-04-21T19:17:24Z
body: I will wait for next commit with fix. 
What do you think to add device model name. 
author_association: COLLABORATOR
user: login: maeek
created_at: 2025-04-22T18:39:29Z
body: > What do you think to add device model name.

I'll keep a generic name for now as I don't even know what's the model that I have 😄. Also a specific model name might not translate well as the API returns a productId which might correspond to the broadlink wifi module thats in the AC, rather than AC itself.

@maczet it's ready for review and tests
author_association: OWNER
user: login: maeek
created_at: 2025-04-22T19:35:34Z
body: I'm testing it more and it seems that it duplicates devices for some reason. Will have to spend more time on that
author_association: OWNER
user: login: maczet
created_at: 2025-04-23T09:41:37Z
body: I tested it and works fine.
author_association: COLLABORATOR