mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-16 18:24:36 +00:00
Updated device return for HUE emulation based on new information of LUX
bulb handling in the API from the Philips dev info.
This commit is contained in:
81
README.md
81
README.md
@@ -395,57 +395,27 @@ If there are no lights in the system then the bridge will return an empty object
|
||||
"state": {
|
||||
"on": true,
|
||||
"bri": 144,
|
||||
"hue": 0,
|
||||
"sat": 254,
|
||||
"xy": [0,0],
|
||||
"ct": 0,
|
||||
"alert": "none",
|
||||
"effect": "none",
|
||||
"colormode": "",
|
||||
"reachable": true
|
||||
},
|
||||
"type": "Dimmable light",
|
||||
"name": "Table Lamp 1",
|
||||
"modelid": "LWB004",
|
||||
"swversion": "65003148",
|
||||
"pointsymbol": {
|
||||
"1": "none",
|
||||
"2": "none",
|
||||
"3": "none",
|
||||
"4": "none",
|
||||
"5": "none",
|
||||
"6": "none",
|
||||
"7": "none",
|
||||
"8": "none"
|
||||
}
|
||||
},
|
||||
"2": {
|
||||
"state": {
|
||||
"on": false,
|
||||
"bri": 0,
|
||||
"hue": 0,
|
||||
"sat": 0,
|
||||
"xy": [0,0],
|
||||
"ct": 0,
|
||||
"alert": "none",
|
||||
"effect": "none",
|
||||
"colormode": "",
|
||||
"reachable": true
|
||||
},
|
||||
"type": "Dimmable light",
|
||||
"name": "Table Lamp 2",
|
||||
"modelid": "LWB004",
|
||||
"swversion": "65003148",
|
||||
"pointsymbol": {
|
||||
"1": "none",
|
||||
"2": "none",
|
||||
"3": "none",
|
||||
"4": "none",
|
||||
"5": "none",
|
||||
"6": "none",
|
||||
"7": "none",
|
||||
"8": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -465,7 +435,6 @@ uniqueid | string 6, 32 | Unique id of the device.
|
||||
manufacturername | string 6, 32 | The manufacturer name will be "Philips".
|
||||
luminaireuniqueid | string 6, 32 | This will be empty.
|
||||
swversion | string 8, 8 | An identifier for the software version running on the light which will be "65003148".
|
||||
Pointsymbol | object | This parameter is reserved for future functionality and returns a preset hashmap.
|
||||
|
||||
The state object contains the following fields
|
||||
|
||||
@@ -473,42 +442,22 @@ Name | Type | Description
|
||||
-----|-------|-------------
|
||||
on | bool | On/Off state of the light. On=true, Off=false
|
||||
bri | uint8 | Brightness of the light. This will be set to 254 as a default.
|
||||
hue | uint16 | This will be empty.
|
||||
sat | uint8 | This will be set to 254.
|
||||
xy | list 2..2 of float 4 | This will be empty.
|
||||
ct | uint16 | This will be empty.
|
||||
alert | string | This will be set to "none".
|
||||
effect | string | This will be set to "none".
|
||||
colormode | string 2, 2 | This will be empty.
|
||||
reachable | bool | Indicates if a light can be reached by the bridge and will be set to true.
|
||||
```
|
||||
{
|
||||
"state": {
|
||||
"hue": 0,
|
||||
"on": true,
|
||||
"effect": "none",
|
||||
"alert": "none",
|
||||
"bri": 254,
|
||||
"sat": 254,
|
||||
"ct": 0,
|
||||
"xy": [0, 0],
|
||||
"reachable": true,
|
||||
"colormode": ""
|
||||
},
|
||||
"type": "Dimmable light",
|
||||
"name": "Kitchen Ceiling",
|
||||
"modelid": "LWB004",
|
||||
"swversion": "65003148",
|
||||
"pointsymbol": {
|
||||
"1": "none",
|
||||
"2": "none",
|
||||
"3": "none",
|
||||
"4": "none",
|
||||
"5": "none",
|
||||
"6": "none",
|
||||
"7": "none",
|
||||
"8": "none"
|
||||
}
|
||||
}
|
||||
```
|
||||
### Set light state
|
||||
@@ -575,57 +524,27 @@ rules | object | A collection of all rules and their attributes. This is not giv
|
||||
"state": {
|
||||
"on": false,
|
||||
"bri": 0,
|
||||
"hue": 0,
|
||||
"sat": 254,
|
||||
"xy": [0.0000, 0.0000],
|
||||
"ct": 0,
|
||||
"alert": "none",
|
||||
"effect": "none",
|
||||
"colormode": "",
|
||||
"reachable": true
|
||||
},
|
||||
"type": "Dimmable light",
|
||||
"name": "Table Lamp 1",
|
||||
"modelid": "LWB004",
|
||||
"swversion": "65003148",
|
||||
"pointsymbol": {
|
||||
"1": "none",
|
||||
"2": "none",
|
||||
"3": "none",
|
||||
"4": "none",
|
||||
"5": "none",
|
||||
"6": "none",
|
||||
"7": "none",
|
||||
"8": "none"
|
||||
}
|
||||
},
|
||||
"2": {
|
||||
"state": {
|
||||
"on": true,
|
||||
"bri": 254,
|
||||
"hue": 0,
|
||||
"sat": 254,
|
||||
"xy": [0, 0],
|
||||
"ct": 0,
|
||||
"alert": "none",
|
||||
"effect": "none",
|
||||
"colormode": "",
|
||||
"reachable": true
|
||||
},
|
||||
"type": "Dimmable light",
|
||||
"name": "Table Lamp 2",
|
||||
"modelid": "LWB004",
|
||||
"swversion": "65003148",
|
||||
"pointsymbol": {
|
||||
"1": "none",
|
||||
"2": "none",
|
||||
"3": "none",
|
||||
"4": "none",
|
||||
"5": "none",
|
||||
"6": "none",
|
||||
"7": "none",
|
||||
"8": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
"scenes":{
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.bwssystems.HABridge</groupId>
|
||||
<artifactId>ha-bridge</artifactId>
|
||||
<version>1.0.7</version>
|
||||
<version>1.0.8</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>HA Bridge</name>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.bwssystems.HABridge.api.hue;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by arm on 4/14/15.
|
||||
*/
|
||||
@@ -14,7 +11,6 @@ public class DeviceResponse {
|
||||
private String manufacturername;
|
||||
private String uniqueid;
|
||||
private String swversion;
|
||||
private Map<String, String> pointsymbol;
|
||||
|
||||
public DeviceState getState() {
|
||||
return state;
|
||||
@@ -72,27 +68,6 @@ public class DeviceResponse {
|
||||
this.swversion = swversion;
|
||||
}
|
||||
|
||||
public Map<String, String> getPointsymbol() {
|
||||
if(pointsymbol == null)
|
||||
{
|
||||
pointsymbol = new HashMap<>();
|
||||
pointsymbol.put("1", "none");
|
||||
pointsymbol.put("2", "none");
|
||||
pointsymbol.put("3", "none");
|
||||
pointsymbol.put("4", "none");
|
||||
pointsymbol.put("5", "none");
|
||||
pointsymbol.put("6", "none");
|
||||
pointsymbol.put("7", "none");
|
||||
pointsymbol.put("8", "none");
|
||||
}
|
||||
|
||||
return pointsymbol;
|
||||
}
|
||||
|
||||
public void setPointsymbol(Map<String, String> pointsymbol) {
|
||||
this.pointsymbol = pointsymbol;
|
||||
}
|
||||
|
||||
public static DeviceResponse createResponse(String name, String id){
|
||||
DeviceState deviceState = new DeviceState();
|
||||
DeviceResponse response = new DeviceResponse();
|
||||
@@ -102,14 +77,13 @@ public class DeviceResponse {
|
||||
deviceState.setEffect("none");
|
||||
deviceState.setAlert("none");
|
||||
deviceState.setBri(254);
|
||||
deviceState.setSat(254);
|
||||
|
||||
response.setName(name);
|
||||
response.setUniqueid(id);
|
||||
response.setManufacturername("Philips");
|
||||
response.setType("Dimmable light");
|
||||
response.setModelid("LWB004");
|
||||
response.setSwversion("65003148");
|
||||
response.setSwversion("66012040");
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.bwssystems.HABridge.api.hue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by arm on 4/14/15.
|
||||
@@ -8,14 +7,9 @@ import java.util.List;
|
||||
public class DeviceState {
|
||||
private boolean on;
|
||||
private int bri = 255;
|
||||
private int hue;
|
||||
private int sat;
|
||||
private String effect;
|
||||
private int ct;
|
||||
private String alert;
|
||||
private String colormode;
|
||||
private boolean reachable;
|
||||
private List<Double> xy;
|
||||
|
||||
public boolean isOn() {
|
||||
return on;
|
||||
@@ -33,22 +27,6 @@ public class DeviceState {
|
||||
this.bri = bri;
|
||||
}
|
||||
|
||||
public int getHue() {
|
||||
return hue;
|
||||
}
|
||||
|
||||
public void setHue(int hue) {
|
||||
this.hue = hue;
|
||||
}
|
||||
|
||||
public int getSat() {
|
||||
return sat;
|
||||
}
|
||||
|
||||
public void setSat(int sat) {
|
||||
this.sat = sat;
|
||||
}
|
||||
|
||||
public String getEffect() {
|
||||
return effect;
|
||||
}
|
||||
@@ -57,14 +35,6 @@ public class DeviceState {
|
||||
this.effect = effect;
|
||||
}
|
||||
|
||||
public int getCt() {
|
||||
return ct;
|
||||
}
|
||||
|
||||
public void setCt(int ct) {
|
||||
this.ct = ct;
|
||||
}
|
||||
|
||||
public String getAlert() {
|
||||
return alert;
|
||||
}
|
||||
@@ -73,14 +43,6 @@ public class DeviceState {
|
||||
this.alert = alert;
|
||||
}
|
||||
|
||||
public String getColormode() {
|
||||
return colormode;
|
||||
}
|
||||
|
||||
public void setColormode(String colormode) {
|
||||
this.colormode = colormode;
|
||||
}
|
||||
|
||||
public boolean isReachable() {
|
||||
return reachable;
|
||||
}
|
||||
@@ -89,14 +51,6 @@ public class DeviceState {
|
||||
this.reachable = reachable;
|
||||
}
|
||||
|
||||
public List<Double> getXy() {
|
||||
return xy;
|
||||
}
|
||||
|
||||
public void setXy(List<Double> xy) {
|
||||
this.xy = xy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DeviceState{" +
|
||||
|
||||
Reference in New Issue
Block a user