Skip to content

Commit

Permalink
Set app active when found in rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
DrRSatzteil committed Sep 26, 2023
1 parent a418df4 commit d7e92cf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,19 +291,6 @@ public BigDecimal[] getProgressC() {
return this.progressC;
}

@Override
public String toString() {
return "AwtrixApp [text=" + text + ", textCase=" + textCase + ", topText=" + topText + ", textOffset="
+ textOffset + ", center=" + center + ", color=" + Arrays.toString(color) + ", gradient="
+ Arrays.toString(gradient) + ", blinkText=" + blinkText + ", fadeText=" + fadeText + ", background="
+ Arrays.toString(background) + ", rainbow=" + rainbow + ", icon=" + icon + ", pushIcon=" + pushIcon
+ ", duration=" + duration + ", line=" + Arrays.toString(line) + ", bar=" + Arrays.toString(bar)
+ ", autoscale=" + autoscale + ", progress=" + progress + ", progressC=" + Arrays.toString(progressC)
+ ", progressBC=" + Arrays.toString(progressBC) + ", scrollSpeed=" + scrollSpeed + ", effect=" + effect
+ ", effectSpeed=" + effectSpeed + ", effectPalette=" + effectPalette + ", effectBlend=" + effectBlend
+ "]";
}

public BigDecimal[] setProgressC() {
return this.progressC;
}
Expand Down Expand Up @@ -360,6 +347,19 @@ public void setEffectBlend(Boolean effectBlend) {
this.effectBlend = effectBlend;
}

@Override
public String toString() {
return "AwtrixApp [text=" + text + ", textCase=" + textCase + ", topText=" + topText + ", textOffset="
+ textOffset + ", center=" + center + ", color=" + Arrays.toString(color) + ", gradient="
+ Arrays.toString(gradient) + ", blinkText=" + blinkText + ", fadeText=" + fadeText + ", background="
+ Arrays.toString(background) + ", rainbow=" + rainbow + ", icon=" + icon + ", pushIcon=" + pushIcon
+ ", duration=" + duration + ", line=" + Arrays.toString(line) + ", bar=" + Arrays.toString(bar)
+ ", autoscale=" + autoscale + ", progress=" + progress + ", progressC=" + Arrays.toString(progressC)
+ ", progressBC=" + Arrays.toString(progressBC) + ", scrollSpeed=" + scrollSpeed + ", effect=" + effect
+ ", effectSpeed=" + effectSpeed + ", effectPalette=" + effectPalette + ", effectBlend=" + effectBlend
+ "]";
}

private boolean getBoolValue(Map<String, Object> params, String key, boolean defaultValue) {
if (params.containsKey(key)) {
Object value = params.get(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,4 +662,11 @@ private void finishInit() {
this.finishInitJob = null;
}
}

public void setActive(boolean active) {
if (this.active != active) {
this.active = active;
updateState(new ChannelUID(channelPrefix + CHANNEL_ACTIVE), active ? OnOffType.ON : OnOffType.OFF);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,9 @@ private void handleCurrentAppMessage(String currentAppMessage) {
localDiscoveryCallback.appDiscovered(this.basetopic, currentAppMessage);
}
}
} else {
AwtrixLightAppHandler alah = this.appHandlers.get(currentAppMessage);
alah.setActive(true);
}
}

Expand Down

0 comments on commit d7e92cf

Please sign in to comment.