Skip to content

Commit

Permalink
Update persistent.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SukramJ committed Aug 20, 2024
1 parent 1be98f9 commit a41faf6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions hahomematic/caches/persistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,9 @@ def _remove_device(self, interface_id: str, deleted_addresses: list[str]) -> Non

for address in deleted_addresses:
try:
if ":" not in address and self._addresses.get(interface_id, {}).get(
address, set()
):
if ":" not in address and self._addresses.get(interface_id, {}).get(address):
del self._addresses[interface_id][address]
if self._device_descriptions.get(interface_id, {}).get(address, {}):
if self._device_descriptions.get(interface_id, {}).get(address):
del self._device_descriptions[interface_id][address]
except KeyError:
_LOGGER.warning("REMOVE_DEVICE failed: Unable to delete: %s", address)
Expand All @@ -178,7 +176,7 @@ def get_addresses(self, interface_id: str) -> tuple[str, ...]:
def get_channels(self, interface_id: str, device_address: str) -> Mapping[str, Channel]:
"""Return the device channels by interface and device_address."""
channels: dict[str, Channel] = {}
for channel_address in self._addresses.get(interface_id, {}).get(device_address, []):
for channel_address in self._addresses.get(interface_id, {}).get(device_address, set()):
channel_name = str(
self.get_device_parameter(
interface_id=interface_id,
Expand Down

0 comments on commit a41faf6

Please sign in to comment.