Skip to content

Commit

Permalink
linting: prepare a bit for future ruff releases.
Browse files Browse the repository at this point in the history
Signed-off-by: Romain Bezut <[email protected]>
  • Loading branch information
morian committed Jan 13, 2025
1 parent 10f704c commit f0a3d39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aio_ld2410/ld2410.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ async def _request(
async with timeout(self._command_timeout):
frame = CommandFrame.build({'data': command})
# Casts are valid here since we just checked `self.connected`.
replies = cast(asyncio.Queue[Optional[ConstructReply]], self._replies)
writer = cast(StreamWriter, self._writer)
replies = cast('asyncio.Queue[Optional[ConstructReply]]', self._replies)
writer = cast('StreamWriter', self._writer)

writer.write(frame)
await writer.drain()
Expand All @@ -313,7 +313,7 @@ async def _request(
logger.warning('Got reply code %u (request was %u)', reply.code, code)

# MyPy does not see that reply cannot be None on here.
reply = cast(ConstructReply, reply)
reply = cast('ConstructReply', reply)
if int(reply.status) != ReplyStatus.SUCCESS:
msg = f'Command {code} received bad status: {reply.status}'
raise CommandStatusError(msg)
Expand Down Expand Up @@ -484,7 +484,7 @@ async def get_next_report(self) -> ReportStatus:
"""
async with self._report_condition:
await self._report_condition.wait()
report = cast(ReportStatus, self._report)
report = cast('ReportStatus', self._report)
return copy.deepcopy(report)

@configuration
Expand Down

0 comments on commit f0a3d39

Please sign in to comment.