Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SukramJ committed Aug 19, 2024
1 parent 1bf8c61 commit 5eef2a4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
31 changes: 15 additions & 16 deletions hahomematic/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,20 +607,19 @@ async def get_paramset_descriptions(
paramsets[address] = {}
_LOGGER.debug("GET_PARAMSET_DESCRIPTIONS for %s", address)
for paramset_key in device_description.get(Description.PARAMSETS, []):
channel_no = get_channel_no(address)
device_type = (
device_description[Description.TYPE]
if channel_no is None
else device_description[Description.PARENT_TYPE]
)
if not (
self.central.config.load_all_paramset_descriptions or load_all
) and not self.central.parameter_visibility.is_relevant_paramset(
device_type=device_type,
channel_no=channel_no,
paramset_key=paramset_key,
):
continue
if not (self.central.config.load_all_paramset_descriptions or load_all):
channel_no = get_channel_no(address)
device_type = (
device_description[Description.TYPE]
if channel_no is None
else device_description[Description.PARENT_TYPE]
)
if not self.central.parameter_visibility.is_relevant_paramset(
device_type=device_type,
channel_no=channel_no,
paramset_key=paramset_key,
):
continue
if paramset_description := await self._get_paramset_description(
address=address, paramset_key=paramset_key
):
Expand Down Expand Up @@ -712,7 +711,7 @@ async def update_paramset_descriptions(self, device_address: str) -> None:
)
return
await self.fetch_paramset_descriptions(
self.central.device_descriptions.get_device(
device_description=self.central.device_descriptions.get_device(
interface_id=self.interface_id, device_address=device_address
)
)
Expand Down Expand Up @@ -783,7 +782,7 @@ async def check_connection_availability(self, handle_ping_pong: bool) -> bool:
if handle_ping_pong and self.supports_ping_pong:
self._ping_pong_cache.handle_send_ping(ping_ts=dt_now)
calllerId = (
f"{self.interface_id}#{dt_now.strftime(DATETIME_FORMAT_MILLIS)}"
f"{self.interface_id}#{dt_now.strftime(format=DATETIME_FORMAT_MILLIS)}"
if handle_ping_pong
else self.interface_id
)
Expand Down
4 changes: 3 additions & 1 deletion hahomematic/platforms/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,9 @@ async def export_data(self) -> None:
)
paramset_descriptions: Mapping[
str, Any
] = await self._client.get_all_paramset_descriptions(tuple(device_descriptions.values()))
] = await self._client.get_all_paramset_descriptions(
device_descriptions=tuple(device_descriptions.values())
)
device_type = device_descriptions[self._device_address][Description.TYPE]
filename = f"{device_type}.json"

Expand Down

0 comments on commit 5eef2a4

Please sign in to comment.