# Async Hue
An async library for Python 3.5+ to control Philips Hue.
```python
import asyncio
from pprint import pprint
from aiohue.discovery import discover_nupnp
async def main():
bridges = await discover_nupnp()
bridge = bridges[0]
await bridge.create_user('aiophue-example')
print('Your username is', bridge.username)
await bridge.initialize()
print('Name', bridge.config.name)
print('Mac', bridge.config.mac)
print()
print('Lights:')
for id in bridge.lights:
light = bridge.lights[id]
print('{}: {}'.format(light.name, 'on' if light.state['on'] else 'off'))
# Change state of a light.
await light.set_state(on=not light.state['on'])
print()
print('Groups:')
for id in bridge.groups:
group = bridge.groups[id]
print('{}: {}'.format(group.name, 'on' if group.action['on'] else 'off'))
# Change state of a group.
await group.set_action(on=not group.state['on'])
asyncio.get_event_loop().run_until_complete(main())
```
An async library for Python 3.5+ to control Philips Hue.
```python
import asyncio
from pprint import pprint
from aiohue.discovery import discover_nupnp
async def main():
bridges = await discover_nupnp()
bridge = bridges[0]
await bridge.create_user('aiophue-example')
print('Your username is', bridge.username)
await bridge.initialize()
print('Name', bridge.config.name)
print('Mac', bridge.config.mac)
print()
print('Lights:')
for id in bridge.lights:
light = bridge.lights[id]
print('{}: {}'.format(light.name, 'on' if light.state['on'] else 'off'))
# Change state of a light.
await light.set_state(on=not light.state['on'])
print()
print('Groups:')
for id in bridge.groups:
group = bridge.groups[id]
print('{}: {}'.format(group.name, 'on' if group.action['on'] else 'off'))
# Change state of a group.
await group.set_action(on=not group.state['on'])
asyncio.get_event_loop().run_until_complete(main())
```
Metadata
Release files for aiohue 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aiohue-0.1.0.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aiohue-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.5 kB
Release files / aiohue-0.1.0.tar.gz
| Download URL | aiohue-0.1.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d7d2e59812b53b320a8646127d163c05352bdf5784e4c90f2a3624d4b3c6971
|
|
BLAKE2b-256 checksum How to use checksums |
308e5d268422e970b785eb069cc290eee49a6efe518bbaf858702f9772952c0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / aiohue-0.1.0-py3-none-any.whl
| Download URL | aiohue-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
10625a0f8abcd88e136d0ea83378fa62da41cf5098ad44d0aca09f5526974d11
|
|
BLAKE2b-256 checksum How to use checksums |
c933ae5c02109a577ea19cd891e2978f9084ba20aa527d3009ca9f8e7a42325b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |