Open JohnCanty opened 5 years ago
switched mode to list, and a similar problem happens. I can create a separate bug for that is need be. Reproducible every time.
Please post a simple code sample that generates the problem above.
from phue import Bridge
Brightness = 254
b = Bridge('10.10.11.2', 'APIKEY')
# If the app is not registered and the button is not pressed, press the button and call connect() (this only needs to be run a single time)
b.connect()
# Get the bridge state (This returns the full dictionary that you can explore)
b.get_api()
# Get the light information from the bridge and store it in a dictionary based on ID as the key.
lights = b.get_light_objects(mode='id')
for lightid,attribute in lights.items():
print(lightid)
print(attribute.on)
print(attribute.brightness)
if attribute.brightness >= 0:
if attribute.on == False:
b.set_light(lightid, 'on', value=True)
b.set_light(lightid, 'bri', value=Brightness)
b.set_light(lightid, 'on', value=False)
else:
b.set_light(lightid, 'bri', value=Brightness)
This executes fine. But if I use the variable explorer to check out the dictionary that is created called 'lights'. The non-color changing lights in the dictionary cause this error.
Thanks for the code @JohnCanty! We'll try to fix this after we release Spyder 4.
Description
What steps will reproduce the problem?
Using Phue library installed in the working directory. perfrom a successful connect to the Hue lighting hub. Stored the lights in a dictionary using the ID as the Key.
lights = b.get_light_objects(mode='id')
Using the variable explorer I opened the entry that was associated with a lamp that is not RGB controllable.
Traceback
Versions
Dependencies