Skip to content

Commit

Permalink
fix: unbound local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
alryaz authored Feb 4, 2025
1 parent c9102f9 commit 58db519
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/pandora_cas/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def _add_command_listener(self, command: CommandOptions | None) -> None:
def _filter_expected_command(evt_or_data) -> bool:
if not isinstance(evt_or_data, dict):
try:
data = evt_or_data.data
evt_or_data = evt_or_data.data
except Exception as exc:
self.logger.error(
"Encountered filtering error while listening for commands: %s",
Expand All @@ -421,8 +421,8 @@ def _filter_expected_command(evt_or_data) -> bool:
)
return False
return (
data.get(ATTR_COMMAND_ID) == command_id
and data.get(ATTR_DEVICE_ID) == self.pandora_device.device_id
evt_or_data.get(ATTR_COMMAND_ID) == command_id
and evt_or_data.get(ATTR_DEVICE_ID) == self.pandora_device.device_id
)

listeners.append(
Expand Down

0 comments on commit 58db519

Please sign in to comment.