studioimaginaire / phue

A Python library for the Philips Hue system
Other
1.54k stars 266 forks source link

TypeError: list indices must be integers, not str #107

Open ghost opened 7 years ago

ghost commented 7 years ago

Hi there, I have the following code. Using the Phue Bridge 2.0 and richer lights Philips Hue set.

from phue import Bridge

b = Bridge('192.168.1.75')

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()

Prints if light 3 is on or not

b.get_light(3, 'on')

i get the following error.

File "C:/Users/joel/Desktop/philipshue/test1.py", line 20, in b.get_light(3, 1) File "C:\Python27\lib\site-packages\phue.py", line 855, in get_light return state['state'][parameter] TypeError: list indices must be integers, not str

bduijnhouwer commented 6 years ago

I get this too. Can help me resolve this?

tonysugent commented 3 years ago

I am also getting this. Did you guys ever figure it out?