* This method is invoked when a currently known ISY (UDProxyDevice) is back
* on line
*/
public void onDeviceOnLine() {
Freedomotic.logger.info("ISY is online ...");
final UDProxyDevice device = getDevice();
if (device == null) {
return;
}
if (device.isSecurityEnabled() || device.securityLevel > UPnPSecurity.NO_SECURITY) {
if (device.isAuthenticated && device.isOnline) {
return;
}
try {
Freedomotic.logger.info("AUTHENICATING/SUBSCRIBING");
Isy99iFrame.writeAreaLog(Isy99iUtilities.getDateTime() + ": Authenticating/Subscribing");
// passing user/pass
authenticate("admin", "admin");
Freedomotic.logger.info("AUTHENICATING/SUBSCRIBING DONE");
Isy99iFrame.writeAreaLog(Isy99iUtilities.getDateTime() + ": Authenticating/Subscribing done");
} catch (NoDeviceException e) {
Freedomotic.logger.severe("Authenticating/Subscribing error");
Isy99iFrame.writeAreaLog(Isy99iUtilities.getDateTime() + ": Authenticating/Subscribing error");
}
} else {
//just subscribe to events
Freedomotic.logger.info("Subscribing");
Isy99iFrame.writeAreaLog(Isy99iUtilities.getDateTime() + ": Subscribing");
device.subscribeToEvents(true);
Freedomotic.logger.info("Subscription done");
Isy99iFrame.writeAreaLog(Isy99iUtilities.getDateTime() + ": Subscription done");
}
}