File: control.py

package info (click to toggle)
python-elgato 5.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 516 kB
  • sloc: python: 1,288; makefile: 8; sh: 5
file content (23 lines) | stat: -rw-r--r-- 522 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
# pylint: disable=W0621
"""Asynchronous Python client for Elgato Lights."""

import asyncio

from elgato import Elgato, State


async def main() -> None:
    """Show example on controlling your Elgato Key device."""
    async with Elgato("elgato-key-light.local") as elgato:
        print(await elgato.info())

        print(await elgato.settings())

        state: State = await elgato.state()

        # Toggle the light
        await elgato.light(on=(not state.on))


if __name__ == "__main__":
    asyncio.run(main())