mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-16 18:24:36 +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>
|
||||
<artifactId>ha-bridge</artifactId>
|
||||
<version>5.2.1c</version>
|
||||
<version>5.2.1d</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>HA Bridge</name>
|
||||
|
||||
@@ -83,6 +83,9 @@ public class DeviceDescriptor{
|
||||
@SerializedName("onFirstDim")
|
||||
@Expose
|
||||
private boolean onFirstDim;
|
||||
@SerializedName("onWhenDimPresent")
|
||||
@Expose
|
||||
private boolean onWhenDimPresent;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
@@ -286,6 +289,14 @@ public class DeviceDescriptor{
|
||||
this.onFirstDim = onFirstDim;
|
||||
}
|
||||
|
||||
public boolean isOnWhenDimPresent() {
|
||||
return onWhenDimPresent;
|
||||
}
|
||||
|
||||
public void setOnWhenDimPresent(boolean onWhenDimPresent) {
|
||||
this.onWhenDimPresent = onWhenDimPresent;
|
||||
}
|
||||
|
||||
public boolean containsType(String aType) {
|
||||
if(aType == null)
|
||||
return false;
|
||||
|
||||
@@ -1186,13 +1186,22 @@ public class HueMulator {
|
||||
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()) {
|
||||
isOnRequest = true;
|
||||
theStateChanges.setOn(true);
|
||||
isDimRequest = false;
|
||||
isColorRequest = false;
|
||||
} else if(device.isOnFirstDim() && isDimRequest && device.getDeviceState().isOn()) {
|
||||
if(device.getDeviceState().getBri() == theStateChanges.getBri()) {
|
||||
isOnRequest = true;
|
||||
theStateChanges.setOn(true);
|
||||
isDimRequest = false;
|
||||
isColorRequest = false;
|
||||
} else {
|
||||
|
||||
@@ -94,6 +94,12 @@
|
||||
ng-model="device.offState" ng-true-value=true
|
||||
ng-false-value=false> {{device.offState}}</td>
|
||||
</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>
|
||||
<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"
|
||||
|
||||
Reference in New Issue
Block a user