[dwdunwetter] Fixed channel update (#9594)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
parent
883b251626
commit
437e73edf4
|
@ -106,25 +106,26 @@ public class DwdUnwetterHandler extends BaseThingHandler {
|
|||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue