studioimaginaire / phue

A Python library for the Philips Hue system
Other
1.53k stars 267 forks source link

TypeError: 'int' object has no attribute '__getitem__' #96

Open wala-a opened 7 years ago

wala-a commented 7 years ago

Code will work if the numbe ID of the light is given, or the actual name of the object. For example, this runs perfectly.

b = Bridge('-----') b.connect() b.lights[0].any_function=##

However, if I assign a variable to that value, it won't work. for example:

b = Bridge('-----') b.connect() l=0 b.lights[l].any_function=##

This throws the error I gave in the title.