February 2022
Intermediate to advanced
182 pages
4h 25m
English
To confirm your effort was successful as well as identify the name and ID of the connected Hue smart plug, create and run the following listdevices.py script that will connect to your Hue bridge and enumerate a list of Hue accessories configured with the bridge:
| | from phue import Bridge |
| | |
| ① | huebridge = Bridge('YOUR_HUE_BRIDGE_IP_GOES_HERE') |
| | |
| ② | lights = huebridge.lights |
| | |
| ③ | for light in lights: |
| | print(light.name) |
Let’s take a quick look at how this script connects to your Hue bridge and identifies the other Hue devices it’s able to manage.
Here we pass the IP address of our Hue bridge into the huebridge object instance.
Next, we interrogate the bridge lights collection and ...
Read now
Unlock full access