Skip to content

Commit

Permalink
MAX! Fix initiation issue (openhab#1495)
Browse files Browse the repository at this point in the history
* MAX! Fix initiation issue

Signed-off-by: Marcel Verpaalen <[email protected]>
  • Loading branch information
marcelrv authored and fharni committed Feb 10, 2017
1 parent 2a12218 commit b0c3aee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public void initialize() {
logger.debug("Exclusive mode {}.", exclusive);
logger.debug("Max Requests {}.", maxRequestsPerConnection);

previousOnline = true; // To trigger offline in case no connection @ startup
startAutomaticRefresh();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.eclipse.smarthome.core.thing.Thing;
import org.eclipse.smarthome.core.thing.ThingStatus;
import org.eclipse.smarthome.core.thing.ThingStatusDetail;
import org.eclipse.smarthome.core.thing.ThingStatusInfo;
import org.eclipse.smarthome.core.thing.ThingUID;
import org.eclipse.smarthome.core.thing.binding.BaseThingHandler;
import org.eclipse.smarthome.core.thing.binding.ThingHandler;
Expand Down Expand Up @@ -550,12 +551,26 @@ private void setProperties(Device device) {
}
}

/* (non-Javadoc)
* @see org.eclipse.smarthome.core.thing.binding.BaseThingHandler#bridgeStatusChanged(org.eclipse.smarthome.core.thing.ThingStatusInfo)
*/
@Override
public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) {
logger.debug("Bridge Status updated to {} for device: {}", bridgeStatusInfo.getStatus().toString(),
getThing().getUID().toString());
if (bridgeStatusInfo.getStatus().equals(ThingStatus.ONLINE)) {
// No action
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
forceRefresh = true;
}
}

/**
* Set the Configurable properties for this device
*
* @param device
*/

private void setDeviceConfiguration(Device device) {
try {
logger.debug("MAX! {} {} configuration update", device.getType().toString(), device.getSerialNumber());
Expand Down

0 comments on commit b0c3aee

Please sign in to comment.