Skip to content

Commit

Permalink
Bump hahomematic to 2024.8.5 (#696)
Browse files Browse the repository at this point in the history
* small cleanups

* Bump hahomematic to 2024.8.5
  • Loading branch information
SukramJ authored Aug 17, 2024
1 parent a80a57c commit 1e0299c
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.0
rev: v0.6.1
hooks:
- id: ruff
args:
Expand Down
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Version 1.65.0 (2024-08-16)

- Bump hahomematic to 2024.8.4
- Bump hahomematic to 2024.8.5
- Add CED for ELV-SH-WUA / HmIP-WUA
- Refactor get_parameters for unignore_candidates
- Make load only relevant paramset descriptions configurable
Expand Down
91 changes: 27 additions & 64 deletions custom_components/homematicip_local/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@
from typing import Any, Final, cast
from urllib.parse import urlparse

from hahomematic.const import (
DEFAULT_TLS,
InterfaceName,
Operations,
ParamsetKey,
SystemInformation,
)
from hahomematic.const import DEFAULT_TLS, InterfaceName, SystemInformation
from hahomematic.exceptions import AuthFailure, BaseHomematicException
import voluptuous as vol
from voluptuous.schema_builder import UNDEFINED, Schema
Expand Down Expand Up @@ -80,7 +74,6 @@
CONF_BIDCOS_WIRED_ENABLED: Final = "bidcos_wired_enabled"
CONF_BIDCOS_WIRED_PORT: Final = "bidcos_wired_port"


IF_BIDCOS_RF_PORT: Final = 2001
IF_BIDCOS_RF_TLS_PORT: Final = 42001
IF_BIDCOS_WIRED_PORT: Final = 2000
Expand Down Expand Up @@ -141,28 +134,6 @@ def get_domain_schema(data: ConfigType) -> Schema:
)


def get_un_ignore_schema(data: ConfigType, all_un_ignore_parameters: list[str]) -> Schema:
"""Return the un_ignore schema."""
existing_parameters: list[str] = [
p for p in data.get(CONF_UN_IGNORE, []) if p in all_un_ignore_parameters
]
return vol.Schema(
{
vol.Required(
CONF_UN_IGNORE,
default=existing_parameters,
): SelectSelector(
config=SelectSelectorConfig(
mode=SelectSelectorMode.DROPDOWN,
multiple=True,
sort=True,
options=all_un_ignore_parameters,
)
),
}
)


def get_options_schema(data: ConfigType) -> Schema:
"""Return the options schema."""
options_schema = get_domain_schema(data=data)
Expand Down Expand Up @@ -226,6 +197,28 @@ def get_interface_schema(use_tls: bool, data: ConfigType, from_config_flow: bool
return interface_schema


def get_un_ignore_schema(data: ConfigType, all_un_ignore_parameters: list[str]) -> Schema:
"""Return the un_ignore schema."""
existing_parameters: list[str] = [
p for p in data.get(CONF_UN_IGNORE, []) if p in all_un_ignore_parameters
]
return vol.Schema(
{
vol.Required(
CONF_UN_IGNORE,
default=existing_parameters,
): SelectSelector(
config=SelectSelectorConfig(
mode=SelectSelectorMode.DROPDOWN,
multiple=True,
sort=False,
options=all_un_ignore_parameters,
)
),
}
)


async def _async_validate_config_and_get_system_information(
hass: HomeAssistant, data: ConfigType
) -> SystemInformation | None:
Expand Down Expand Up @@ -385,7 +378,10 @@ async def async_step_un_ignore(
return self.async_show_form(
step_id="un_ignore",
data_schema=get_un_ignore_schema(
data=self.data, all_un_ignore_parameters=self._get_un_ignore_parameters()
data=self.data,
all_un_ignore_parameters=self._control_unit.central.get_un_ignore_candidates(
include_master=False
),
),
)
_update_un_ignore_input(data=self.data, un_ignore_input=un_ignore_input)
Expand Down Expand Up @@ -424,39 +420,6 @@ async def _validate_and_finish_options_flow(self) -> ConfigFlowResult:
description_placeholders=description_placeholders,
)

def _get_un_ignore_parameters(self) -> list[str]:
"""Return all un_ignore parameters."""
return list(
# 1. request simple parameter list for values parameters
# 2. request full_format parameter list with channel wildcard for values parameters
# 3. request full_format parameter list for values parameters
# 4. request full_format parameter list for master parameters
self._control_unit.central.get_parameters(
paramset_key=ParamsetKey.VALUES,
operations=(Operations.READ, Operations.EVENT),
un_ignore_candidates_only=True,
)
+ self._control_unit.central.get_parameters(
paramset_key=ParamsetKey.VALUES,
operations=(Operations.READ, Operations.EVENT),
full_format=True,
un_ignore_candidates_only=True,
use_channel_wildcard=True,
)
+ self._control_unit.central.get_parameters(
paramset_key=ParamsetKey.VALUES,
operations=(Operations.READ, Operations.EVENT),
full_format=True,
un_ignore_candidates_only=True,
)
+ self._control_unit.central.get_parameters(
paramset_key=ParamsetKey.MASTER,
operations=(Operations.READ,),
full_format=True,
un_ignore_candidates_only=True,
)
)


def _get_ccu_data(data: ConfigType, user_input: ConfigType) -> ConfigType:
return {
Expand Down
1 change: 1 addition & 0 deletions custom_components/homematicip_local/control_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def _create_central(self) -> CentralUnit:
interface_configs=interface_configs,
start_direct=self._start_direct,
un_ignore_list=self._config_data.get(CONF_UN_IGNORE),
load_all_paramset_descriptions=False,
).create_central(extended_validation=False)


Expand Down
2 changes: 1 addition & 1 deletion custom_components/homematicip_local/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"iot_class": "local_push",
"issue_tracker": "https://github.com/danielperna84/hahomematic/issues",
"loggers": ["hahomematic"],
"requirements": ["hahomematic==2024.8.4"],
"requirements": ["hahomematic==2024.8.5"],
"ssdp": [
{
"manufacturer": "EQ3",
Expand Down
6 changes: 3 additions & 3 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
-r requirements_test_pre_commit.txt

async-upnp-client==0.40.0
hahomematic==2024.8.4
homeassistant==2024.8.1
hahomematic==2024.8.5
homeassistant==2024.8.2
mypy==1.11.1
mypy-dev==1.11.0a9
pre-commit==3.8.0
pydevccu==0.1.8
pylint==3.2.6
pytest-homeassistant-custom-component==0.13.153
pytest-homeassistant-custom-component==0.13.154
2 changes: 1 addition & 1 deletion requirements_test_pre_commit.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bandit==1.7.9
codespell==2.3.0
ruff==0.6.0
ruff==0.6.1
yamllint==1.35.1

0 comments on commit 1e0299c

Please sign in to comment.