Skip to content

Commit

Permalink
Use cross platform asyncio sleep instead of sleep_ms
Browse files Browse the repository at this point in the history
  • Loading branch information
bjpirt committed Dec 15, 2023
1 parent a5a28ae commit bdb58c9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bms/mqtt_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ async def main(self):
while True:
if self.enabled and self._network.connected:
self._publish()
try:
await asyncio.sleep_ms(1)
except: # pylint: disable=bare-except
await asyncio.sleep(0.001)
await asyncio.sleep(0.001)
if self.connected:
self._client.check_msg()
if self._full_publish_interval.ready:
Expand Down

0 comments on commit bdb58c9

Please sign in to comment.