Skip to content

Commit 1d58f75

Browse files
committed
make mypy checks pass
1 parent 9c5d46b commit 1d58f75

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎src/powersensor_local/devices.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,13 @@ async def _emit_if_subscribed(self, ev: str, obj: dict) -> None:
133133
obj['event'] = ev
134134
await self._event_cb(obj)
135135

136-
async def _reemit(self, ev: str, obj: dict) -> None:
137-
mac = obj.get('mac')
136+
async def _reemit(self, ev: str, obj: dict[str, str]) -> None:
137+
mac: str|None = obj.get('mac')
138+
if mac is None:
139+
# we don't log anything in this library, but if we did perhaps
140+
# _LOGGER.warning("Received event '%s' with no MAC address -- ignoring", ev) might be appropriate
141+
# for now...silence
142+
return
138143
device = self._devices.get(mac)
139144
if device is not None:
140145
device.mark_active()

0 commit comments

Comments
 (0)