color fix

This commit is contained in:
Yorick Rommers
2015-12-01 13:08:40 +01:00
parent 1109d90dca
commit 597309ca72
2 changed files with 12 additions and 9 deletions
+1 -3
View File
@@ -44,7 +44,7 @@ namespace HueUWP
{
if(l.IsOn)
{
var json = await nwh.SetLightInfo(l.ID, $"{{\"bri\": {l.Brightness},\"hue\": {l.Hue*255},\"sat\": {l.Saturation}}}");
var json = await nwh.SetLightInfo(l.ID, $"{{\"bri\": {l.Brightness-1},\"hue\": {(l.Hue/360)*65535},\"sat\": {l.Saturation*254}}}");
Debug.WriteLine(json);
}
@@ -55,9 +55,7 @@ namespace HueUWP
List<Light> lightlist = new List<Light>();
try {
var json = await nwh.AllLights();
Debug.WriteLine(json);
JObject o = JObject.Parse(json);
Debug.WriteLine(o.ToString());
for (int i = 1; i <= o.Count; i++)
{