mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-18 00:10:20 +00:00
add new device param for on with dim and changed behavior for onFirstDim
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.bwssystems.HABridge</groupId>
|
<groupId>com.bwssystems.HABridge</groupId>
|
||||||
<artifactId>ha-bridge</artifactId>
|
<artifactId>ha-bridge</artifactId>
|
||||||
<version>5.2.1c</version>
|
<version>5.2.1d</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>HA Bridge</name>
|
<name>HA Bridge</name>
|
||||||
|
|||||||
@@ -83,6 +83,9 @@ public class DeviceDescriptor{
|
|||||||
@SerializedName("onFirstDim")
|
@SerializedName("onFirstDim")
|
||||||
@Expose
|
@Expose
|
||||||
private boolean onFirstDim;
|
private boolean onFirstDim;
|
||||||
|
@SerializedName("onWhenDimPresent")
|
||||||
|
@Expose
|
||||||
|
private boolean onWhenDimPresent;
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
@@ -286,6 +289,14 @@ public class DeviceDescriptor{
|
|||||||
this.onFirstDim = onFirstDim;
|
this.onFirstDim = onFirstDim;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isOnWhenDimPresent() {
|
||||||
|
return onWhenDimPresent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnWhenDimPresent(boolean onWhenDimPresent) {
|
||||||
|
this.onWhenDimPresent = onWhenDimPresent;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean containsType(String aType) {
|
public boolean containsType(String aType) {
|
||||||
if(aType == null)
|
if(aType == null)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1186,13 +1186,22 @@ public class HueMulator {
|
|||||||
isOnRequest = true;
|
isOnRequest = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!device.isOnFirstDim() && device.isOnWhenDimPresent() && isDimRequest) {
|
||||||
|
isOnRequest = true;
|
||||||
|
theStateChanges.setOn(true);
|
||||||
|
} else if(!device.isOnFirstDim() && !device.isOnWhenDimPresent() && isDimRequest) {
|
||||||
|
isOnRequest = false;
|
||||||
|
}
|
||||||
|
|
||||||
if(device.isOnFirstDim() && isDimRequest && !device.getDeviceState().isOn()) {
|
if(device.isOnFirstDim() && isDimRequest && !device.getDeviceState().isOn()) {
|
||||||
isOnRequest = true;
|
isOnRequest = true;
|
||||||
|
theStateChanges.setOn(true);
|
||||||
isDimRequest = false;
|
isDimRequest = false;
|
||||||
isColorRequest = false;
|
isColorRequest = false;
|
||||||
} else if(device.isOnFirstDim() && isDimRequest && device.getDeviceState().isOn()) {
|
} else if(device.isOnFirstDim() && isDimRequest && device.getDeviceState().isOn()) {
|
||||||
if(device.getDeviceState().getBri() == theStateChanges.getBri()) {
|
if(device.getDeviceState().getBri() == theStateChanges.getBri()) {
|
||||||
isOnRequest = true;
|
isOnRequest = true;
|
||||||
|
theStateChanges.setOn(true);
|
||||||
isDimRequest = false;
|
isDimRequest = false;
|
||||||
isColorRequest = false;
|
isColorRequest = false;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -94,6 +94,12 @@
|
|||||||
ng-model="device.offState" ng-true-value=true
|
ng-model="device.offState" ng-true-value=true
|
||||||
ng-false-value=false> {{device.offState}}</td>
|
ng-false-value=false> {{device.offState}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><label>On when Dim is present (Always uses on with a dim request otherwise it will ignore a given on was well. This is overidden by onFirstDim.)</label></td>
|
||||||
|
<td><input type="checkbox"
|
||||||
|
ng-model="device.onWhenDimPresent" ng-true-value=true
|
||||||
|
ng-false-value=false> {{device.onWhenDimPresent}}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><label>On with First Dim (If the device is not on in the ha-bridge state, it will send on instead of the dim.)</label></td>
|
<td><label>On with First Dim (If the device is not on in the ha-bridge state, it will send on instead of the dim.)</label></td>
|
||||||
<td><input type="checkbox"
|
<td><input type="checkbox"
|
||||||
|
|||||||
Reference in New Issue
Block a user