Open ivandrofly opened 4 years ago
Am also experiencing this issue on a LB-130. Any workaround?
Am also experiencing this issue on a LB-130. Any workaround?
I'm currently working on a patch for this.. maybe I need accelerate a bit :)
Saw your PR, I'd help but my .NET experience is extremely lacking hahaha
Saw your PR, I'd help but my .NET experience is extremely lacking hahaha
No worries, I got your back 😄 !
I just checked on this issue and it seems like it is caused because the command to change colour is build wrong. Not because it does not allow multiple commands at once. There simply is not a light_state object, instead all arguments are directly passed with transition_light_state So changing this:
Execute("smartlife.iot.smartbulb.lightingservice", "transition_light_state", "light_state", new JObject
{
new JProperty("hue", hsv.Hue),
new JProperty("saturation", hsv.Saturation),
new JProperty("brightness", (int)(hsv.Value * 100 / 255)),
});
to below, should solve the problem. At least it does for my KL-130, no clue about LB-130 yet :)
Execute("smartlife.iot.smartbulb.lightingservice", "transition_light_state", new JObject
{
new JProperty("hue", hsv.Hue),
new JProperty("saturation", hsv.Saturation),
new JProperty("brightness", (int)(hsv.Value * 100 / 255)),
}, null);
I just checked on this issue and it seems like it is caused because the command to change colour is build wrong. Not because it does not allow multiple commands at once. There simply is not a light_state object, instead all arguments are directly passed with transition_light_state So changing this:
Execute("smartlife.iot.smartbulb.lightingservice", "transition_light_state", "light_state", new JObject { new JProperty("hue", hsv.Hue), new JProperty("saturation", hsv.Saturation), new JProperty("brightness", (int)(hsv.Value * 100 / 255)), });
to below, should solve the problem. At least it does for my KL-130, no clue about LB-130 yet :)
Execute("smartlife.iot.smartbulb.lightingservice", "transition_light_state", new JObject { new JProperty("hue", hsv.Hue), new JProperty("saturation", hsv.Saturation), new JProperty("brightness", (int)(hsv.Value * 100 / 255)), }, null);
Alright I will test your solution and report back! Thanks for information
I haven't test your code yet, but new JProperty("brightness", (int)(hsv.Value * 100 / 255)),
will still 'cause problem... the KL-130 model color are represented in degrees from 0-360
I haven't test your code yet, but
new JProperty("brightness", (int)(hsv.Value * 100 / 255)),
will still 'cause problem... the KL-130 model color are represented in degrees from 0-360
Yes, that is true. I removed that nonsense in my tests too. when building the project from _color_changingfix branch I am now able to apply every color I could think of.
Yes, that is true. I removed that nonsense in my tests too. when building the project from _color_changingfix branch I am now able to apply every color I could think of.
Nice, if you have any uncommitted changes please push them so I can rebase my branch/PR onto that...
see: https://github.com/CodeBardian/tplink-smartdevices-netstandard/issues/5#issuecomment-686252075