1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#!/usr/bin/env python
"""Simple Hyperion client read demonstration."""
import asyncio
from hyperion import client, const
HOST = "hyperion"
async def print_brightness() -> None:
"""Print Hyperion brightness."""
async with client.HyperionClient(HOST) as hyperion_client:
assert hyperion_client
adjustment = hyperion_client.adjustment
assert adjustment
print("Brightness: %i%%" % adjustment[0][const.KEY_BRIGHTNESS])
if __name__ == "__main__":
asyncio.get_event_loop().run_until_complete(print_brightness())
|