Skip to content

Commit

Permalink
[dwdunwetter] Fixed channel update (#9594)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Weitkamp <[email protected]>
  • Loading branch information
cweitkamp committed Jan 10, 2021
1 parent 760aa87 commit bf1754e
Showing 1 changed file with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,25 +106,26 @@ private void refresh() {

for (int i = 0; i < warningCount; i++) {
State warning = warningsData.getWarning(i);
int warningNumber = i + 1;
if (warning == OnOffType.OFF) {
updateState(getChannelUuid(CHANNEL_WARNING, i), warning);
updateState(getChannelUuid(CHANNEL_WARNING, warningNumber), warning);
}
updateState(getChannelUuid(CHANNEL_SEVERITY, i), warningsData.getSeverity(i));
updateState(getChannelUuid(CHANNEL_DESCRIPTION, i), warningsData.getDescription(i));
updateState(getChannelUuid(CHANNEL_EFFECTIVE, i), warningsData.getEffective(i));
updateState(getChannelUuid(CHANNEL_EXPIRES, i), warningsData.getExpires(i));
updateState(getChannelUuid(CHANNEL_ONSET, i), warningsData.getOnset(i));
updateState(getChannelUuid(CHANNEL_EVENT, i), warningsData.getEvent(i));
updateState(getChannelUuid(CHANNEL_HEADLINE, i), warningsData.getHeadline(i));
updateState(getChannelUuid(CHANNEL_ALTITUDE, i), warningsData.getAltitude(i));
updateState(getChannelUuid(CHANNEL_CEILING, i), warningsData.getCeiling(i));
updateState(getChannelUuid(CHANNEL_INSTRUCTION, i), warningsData.getInstruction(i));
updateState(getChannelUuid(CHANNEL_URGENCY, i), warningsData.getUrgency(i));
updateState(getChannelUuid(CHANNEL_SEVERITY, warningNumber), warningsData.getSeverity(i));
updateState(getChannelUuid(CHANNEL_DESCRIPTION, warningNumber), warningsData.getDescription(i));
updateState(getChannelUuid(CHANNEL_EFFECTIVE, warningNumber), warningsData.getEffective(i));
updateState(getChannelUuid(CHANNEL_EXPIRES, warningNumber), warningsData.getExpires(i));
updateState(getChannelUuid(CHANNEL_ONSET, warningNumber), warningsData.getOnset(i));
updateState(getChannelUuid(CHANNEL_EVENT, warningNumber), warningsData.getEvent(i));
updateState(getChannelUuid(CHANNEL_HEADLINE, warningNumber), warningsData.getHeadline(i));
updateState(getChannelUuid(CHANNEL_ALTITUDE, warningNumber), warningsData.getAltitude(i));
updateState(getChannelUuid(CHANNEL_CEILING, warningNumber), warningsData.getCeiling(i));
updateState(getChannelUuid(CHANNEL_INSTRUCTION, warningNumber), warningsData.getInstruction(i));
updateState(getChannelUuid(CHANNEL_URGENCY, warningNumber), warningsData.getUrgency(i));
if (warning == OnOffType.ON) {
updateState(getChannelUuid(CHANNEL_WARNING, i), warning);
updateState(getChannelUuid(CHANNEL_WARNING, warningNumber), warning);
}
if (warningsData.isNew(i)) {
triggerChannel(getChannelUuid(CHANNEL_UPDATED, i), "NEW");
triggerChannel(getChannelUuid(CHANNEL_UPDATED, warningNumber), "NEW");
}
}

Expand Down

0 comments on commit bf1754e

Please sign in to comment.