use of org.openhab.habdroid.core.notifications.NotificationSettings in project openhab-android by openhab.
the class OpenHABMainActivity method getNotificationSettings.
/**
* Returns the notification settings object
* @return Returns the NotificationSettings or null, if openHAB-cloud isn't used
*/
public NotificationSettings getNotificationSettings() {
if (mNotifySettings != null) {
return mNotifySettings;
}
Connection cloudConnection = ConnectionFactory.getConnection(TYPE_CLOUD);
if (cloudConnection == null) {
return null;
}
// check whether URL is valid
try {
new URL(cloudConnection.getOpenHABUrl());
mNotifySettings = new NotificationSettings(cloudConnection);
return mNotifySettings;
} catch (MalformedURLException e) {
return null;
}
}
Aggregations