fishbigger / TapoP100

A module for controlling the TP-Link Tapo P100 Plugs
MIT License
572 stars 142 forks source link

Colors not working after setColorTemp() call on L530E v 2.0 #83

Closed pnuu closed 2 years ago

pnuu commented 2 years ago

For L530E v 2.0 with the latest firmware (1.0.9 Build 220526 Rel.203202), setting the color stops working after the color temperature has been set.

Example code:

lamp = PyL530.L530(ip_, user, passwd)
lamp.handshake()
lamp.login()
# This works, sets the lamp to red
lamp.setColor(0, 100)
# Prints "0 100"
res = lamp.getDeviceInfo()['result'] 
print(res['hue'], res['saturation'])
# Set to warm white
lamp.setColorTemp(2700)
# This doesn't change the color
lamp.setColor(100, 100)
# But the attributes have changed, this prints "100 100"
res = lamp.getDeviceInfo()['result'] 
print(res['hue'], res['saturation'])

Setting color temperature and brightness still work.

The only way I've gotten the colors to work again is to use the Tapo app to change any of the attributes (brightness, color, color temp).

pnuu commented 2 years ago

Comparing the lamp.getDeviceInfo()['result'] dictionary after using the Tapo app, it seems that a workaround is to set the color temperature to zero. So this works:

# Warm white
lamp.setColorTemp(2700)
# Set color to red, doesn't have any effect
lamp.setColor(0, 100)
# Set color temp to zero -> changes the bulb to red
lamp.setColorTemp(0)

I'll see if I can put this into an PR so that the additional lamp.setColorTemp(0) isn't needed.