plasticrake / tplink-smarthome-api

TP-Link Smarthome WiFi API
MIT License
1.02k stars 141 forks source link

color_temp invalidates subsequent light states #142

Closed jottinger closed 1 year ago

jottinger commented 2 years ago

We're seeing an issue where we can set color_temp (kelvin) and then subsequent calls to the same device to set brightness or hue or saturation are being accepted but not changing the light state. This is on KL130.

jottinger commented 2 years ago

@plasticrake if. you need I can show the behavior, and I'm more than happy to help in any way I can - I just don't know how to set up a development environment to properly diagnose and fix.

plasticrake commented 2 years ago

This sounds like an issue at the device level. Calling setLightState just passes the commands you pass in to the device. If the device is not responding to it perhaps the device is expecting different command inputs. Example code would help.

mattcave commented 1 year ago

Just came across the same issue. It seems that color_temp overrides the hue. Resolved by setting color_temp to 0

        device.lighting.setLightState({
            on_off: 1,
            mode: 'normal',
            hue: 120,
            color_temp: 0,
            saturation: 100,
            brightness: 5
          })
          .then(console.log)