File: example_poll.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 (29 lines) | stat: -rw-r--r-- 580 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
27
28
29
"""Poll fire place examples."""

import asyncio
import logging
import os

from intellifire4py.local_api import IntelliFireAPILocal


logging.basicConfig(level=logging.DEBUG)


async def main() -> None:
    """Define main function."""
    print(
        """
    Accessing IFT_IP environment variable to connect to fireplace
    """
    )
    ip = os.environ["IFT_IP"]

    api = IntelliFireAPILocal(fireplace_ip=ip)
    await api.poll(suppress_warnings=False)
    print(api.data)


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