private final ThingTypeUID thingTypeUID;
private final String thingID;
+ private String currentThingStatus = "";
+ private boolean currentThingFailed = false;
+
public AndroidTVHandler(Thing thing, AndroidTVDynamicCommandDescriptionProvider commandDescriptionProvider,
AndroidTVTranslationProvider translationProvider, ThingTypeUID thingTypeUID) {
super(thing);
}
public void checkThingStatus() {
+ String currentThingStatus = this.currentThingStatus;
+ boolean currentThingFailed = this.currentThingFailed;
+
String statusMessage = "";
boolean failed = false;
}
}
- if (failed) {
- updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, statusMessage);
- } else {
- updateStatus(ThingStatus.ONLINE);
+ if (!currentThingStatus.equals(statusMessage) || (currentThingFailed != failed)) {
+ if (failed) {
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, statusMessage);
+ } else {
+ updateStatus(ThingStatus.ONLINE);
+ }
}
+
+ this.currentThingStatus = statusMessage;
+ this.currentThingFailed = failed;
}
@Override