Skip to content

Commit

Permalink
[Hueemulation] Fix xy change response and fix light IDs
Browse files Browse the repository at this point in the history
Signed-off-by: Flole <flole@flole.de>
  • Loading branch information
Flole998 committed May 15, 2021
1 parent 9ba28a5 commit 4772c36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public String mapItemUIDtoHueID(Item item) {
public String getHueUniqueId(final String hueId) {
String unique = hueId;
try {
unique = String.format("%02X", Integer.valueOf(hueId));
unique = String.format("%X", Integer.valueOf(hueId));
} catch (final NumberFormatException | IllegalFormatException e) {
// Use the hueId as is
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
package org.openhab.io.hueemulation.internal.dto.response;

import java.lang.reflect.Type;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
Expand Down Expand Up @@ -65,6 +67,9 @@ public JsonElement serialize(HueSuccessResponseStateChanged product, Type type,
if (product.value instanceof String) {
jObj.addProperty(product.relURI, (String) product.value);
}
if (product.value instanceof List) {
jObj.addProperty(product.relURI, new Gson().toJson(product.value));
}
return jObj;
}
}
Expand Down

0 comments on commit 4772c36

Please sign in to comment.