mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-21 09:13:21 +00:00
Updating how controllers work together with shared data.
This commit is contained in:
@@ -106,8 +106,8 @@ public class DeviceResponse {
|
||||
deviceState.setCt(313);
|
||||
|
||||
List<Double> xv = new LinkedList<>();
|
||||
xv.add(0.4255);
|
||||
xv.add(0.3998);
|
||||
xv.add(Double.valueOf("0.4255"));
|
||||
xv.add(Double.valueOf("0.3998"));
|
||||
deviceState.setXy(xv);
|
||||
deviceState.setColormode("ct");
|
||||
response.setName(name);
|
||||
|
||||
@@ -62,12 +62,15 @@ public class DeviceRepository {
|
||||
}
|
||||
|
||||
private void put(int id, DeviceDescriptor aDescriptor) {
|
||||
devices.put(String.valueOf(id),aDescriptor);
|
||||
devices.put(String.valueOf(id), aDescriptor);
|
||||
}
|
||||
|
||||
public void save(DeviceDescriptor aDescriptor) {
|
||||
int id = random.nextInt(Integer.MAX_VALUE);
|
||||
aDescriptor.setId(String.valueOf(id));
|
||||
if(aDescriptor.getId() != null)
|
||||
devices.remove(aDescriptor.getId());
|
||||
else
|
||||
aDescriptor.setId(String.valueOf(id));
|
||||
put(id, aDescriptor);
|
||||
JsonTransformer aRenderer = new JsonTransformer();
|
||||
String jsonValue = aRenderer.render(findAll());
|
||||
|
||||
Reference in New Issue
Block a user