mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[radiothermostat] Skip shutdown actions if thing offline (#16677)
Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
This commit is contained in:
parent
6ebf0f974e
commit
7eb5916804
@ -288,13 +288,20 @@ public class RadioThermostatHandler extends BaseThingHandler implements RadioThe
|
||||
connector.removeEventListener(this);
|
||||
|
||||
// Disable Remote Temp and Message Area on shutdown
|
||||
if (isLinked(REMOTE_TEMP)) {
|
||||
if (ThingStatus.ONLINE.equals(this.getThing().getStatus())) {
|
||||
final boolean isRemoteTempLinked = isLinked(REMOTE_TEMP);
|
||||
final boolean isMessageLinked = isLinked(MESSAGE);
|
||||
|
||||
scheduler.schedule(() -> {
|
||||
if (isRemoteTempLinked) {
|
||||
connector.sendCommand("rem_mode", "0", REMOTE_TEMP_RESOURCE);
|
||||
}
|
||||
|
||||
if (isLinked(MESSAGE)) {
|
||||
if (isMessageLinked) {
|
||||
connector.sendCommand("mode", "0", PMA_RESOURCE);
|
||||
}
|
||||
}, 0, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
ScheduledFuture<?> refreshJob = this.refreshJob;
|
||||
if (refreshJob != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user