Skip to content

Commit

Permalink
Feature Updates
Browse files Browse the repository at this point in the history
Added better support for Comfort and Combi302
  • Loading branch information
veista committed Nov 30, 2022
1 parent 1d9227c commit 60b4ba7
Show file tree
Hide file tree
Showing 6 changed files with 461 additions and 192 deletions.
15 changes: 11 additions & 4 deletions custom_components/nilan/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,30 @@

async def async_setup_entry(hass, config_entry, async_add_entities):
"""Add climate entities for a config entry."""
supported_features = SUPPORT_FAN_MODE | SUPPORT_TARGET_HUMIDITY
supported_features = SUPPORT_FAN_MODE

hvac_basic_attributes = [
"get_run_state",
"get_ventilation_step",
"get_operation_mode",
"get_user_humidity_setpoint",
"get_humidity",
"get_inlet_speed_step",
"get_ventilation_state",
"get_control_state",
]
hvac_temperature_attributes = [
"get_user_temperature_setpoint",
"get_room_master_temperature",
"get_control_temperature",
]

hvac_preset_attributes = [
"get_air_exchange_mode",
]

hvac_humidity_attributes = [
"get_user_humidity_setpoint",
"get_humidity",
]

# refine to select supported features automatically
entities = []
device = hass.data[DOMAIN][config_entry.entry_id]
Expand All @@ -89,6 +92,10 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
attribute in device.get_attributes for attribute in hvac_preset_attributes
):
supported_features |= SUPPORT_PRESET_MODE
if all(
attribute in device.get_attributes for attribute in hvac_humidity_attributes
):
supported_features |= SUPPORT_TARGET_HUMIDITY
entities.append(NilanClimate(device, supported_features))
async_add_entities(entities, True)

Expand Down
Loading

0 comments on commit 60b4ba7

Please sign in to comment.