File: example_scene.py

package info (click to toggle)
pyfibaro 0.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 460 kB
  • sloc: python: 1,931; sh: 9; makefile: 3
file content (31 lines) | stat: -rw-r--r-- 647 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
30
31
"""Manual test class."""

import logging

from pyfibaro.fibaro_client import FibaroClient

from . import FIBARO_PASSWORD, FIBARO_URL, FIBARO_USERNAME


def main():
    """Main method for testing purposes"""

    logging.basicConfig(level=logging.DEBUG)

    print("Start test...")

    client = FibaroClient(FIBARO_URL)
    client.set_authentication(FIBARO_USERNAME, FIBARO_PASSWORD)
    client.connect()

    scenes = client.read_scenes()
    for scene in scenes:
        print(f"Scene {scene.fibaro_id}: {scene.name}")

        if scene.fibaro_id == 19:
            scene.start()
            scene.stop()


if __name__ == "__main__":
    main()