+ async def _do_watch(self, client):
+ while not self._stop:
+ self._log(logging.INFO, "WATCHING...")
+
+ await client.sync()
+
+ if await self._joined_room_id(client) == None:
+ self._is_member = False
+ self._tickle_fifo()
+ else:
+ self._is_member = True
+
+ await asyncio.sleep(3.0)
+
+ def _tickle_fifo(self):
+ fifo = -1
+ try:
+ fifo = posix.open(self._fifo_path, posix.O_WRONLY | posix.O_NONBLOCK)
+ posix.write(fifo, "\n".encode())
+ except OSError as e:
+ if e.errno == errno.ENXIO:
+ pass
+ finally:
+ if fifo != -1:
+ posix.close(fifo)
+