File: example_discovery.py

package info (click to toggle)
python-intellifire4py 4.1.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 620 kB
  • sloc: python: 2,585; sh: 13; makefile: 5
file content (26 lines) | stat: -rw-r--r-- 664 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Example usage of the Library."""
import asyncio
import logging

from intellifire4py.udp import UDPFireplaceFinder


logging.basicConfig(level=logging.DEBUG)


async def main() -> None:
    """Run main function."""
    timeout = 1
    print(f"----- Find Fire Places - (waiting {timeout} seconds)-----")
    af = UDPFireplaceFinder()
    print(await af.search_fireplace(timeout=timeout))

    timeout = 12
    print(f"----- Find Fire Places - (waiting {timeout} seconds)-----")
    af = UDPFireplaceFinder()
    print(await af.search_fireplace(timeout=timeout))


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())