Skip to content

Commit

Permalink
Fix get_parameters (#1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
SukramJ authored Aug 16, 2024
1 parent 50dc64b commit 2de68b8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
22 changes: 12 additions & 10 deletions hahomematic/central/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,18 +1049,20 @@ def get_parameters(
p_operations = paramset[Description.OPERATIONS]
for operation in operations:
if all(p_operations & operation for operation in operations):
if (
un_ignore_candidates_only
and (
generic_entity := self.get_generic_entity(
channel_address=channel_address,
parameter=parameter,
paramset_key=paramset_key,
if un_ignore_candidates_only and (
(
(
generic_entity := self.get_generic_entity(
channel_address=channel_address,
parameter=parameter,
paramset_key=paramset_key,
)
)
and generic_entity.enabled_default
and not generic_entity.is_un_ignored
)
and generic_entity.enabled_default
and not generic_entity.is_un_ignored
) or parameter in IGNORE_FOR_UN_IGNORE_PARAMETERS:
or parameter in IGNORE_FOR_UN_IGNORE_PARAMETERS
):
continue
parameters.add(
f"{parameter}@{device_type}:{get_channel_no(channel_address)}:{paramset_key}"
Expand Down
8 changes: 4 additions & 4 deletions tests/test_central.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,9 @@ async def test_ignore_device_type(
),
[
((Operations.READ, Operations.EVENT), True, True, 43),
((Operations.READ, Operations.EVENT), True, False, 55),
((Operations.READ, Operations.EVENT), True, False, 57),
((Operations.READ, Operations.EVENT), False, True, 31),
((Operations.READ, Operations.EVENT), False, False, 41),
((Operations.READ, Operations.EVENT), False, False, 43),
],
)
async def test_all_parameters(
Expand Down Expand Up @@ -454,9 +454,9 @@ async def test_all_parameters(
),
[
((Operations.READ, Operations.EVENT), True, True, 44),
((Operations.READ, Operations.EVENT), True, False, 55),
((Operations.READ, Operations.EVENT), True, False, 57),
((Operations.READ, Operations.EVENT), False, True, 31),
((Operations.READ, Operations.EVENT), False, False, 41),
((Operations.READ, Operations.EVENT), False, False, 43),
],
)
async def test_all_parameters_with_un_ignore(
Expand Down

0 comments on commit 2de68b8

Please sign in to comment.