Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Commit

Permalink
shutter: ping
Browse files Browse the repository at this point in the history
  • Loading branch information
jordens committed Nov 12, 2018
1 parent 2fecc58 commit cbe3526
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ptb/shutter_protocol.py
Expand Up @@ -29,6 +29,16 @@ async def version(self):
"""
return (await self.ask(b"v")).strip()

async def ping(self):
try:
await self.version()
except asyncio.CancelledError:
raise
except:
logger.warning("ping failed", exc_info=True)
return False
return True

async def status(self):
"""Return the error flags on all channels.
Expand Down

0 comments on commit cbe3526

Please sign in to comment.