import static org.openhab.binding.shelly.internal.util.ShellyUtils.getString;
+import java.io.EOFException;
import java.net.ConnectException;
import java.net.MalformedURLException;
import java.net.NoRouteToHostException;
Class<?> exType = getCauseClass();
return isUnknownHost() || isMalformedURL() || exType == ConnectException.class
|| exType == SocketException.class || exType == PortUnreachableException.class
- || exType == NoRouteToHostException.class;
+ || exType == NoRouteToHostException.class || exType == EOFException.class;
}
public boolean isNoRouteToHost() {
public static boolean isGeneration2(String thingType) {
return thingType.startsWith("shellyplus") || thingType.startsWith("shellypro") || thingType.contains("mini")
|| thingType.startsWith("shellywall") || (thingType.startsWith("shelly") && thingType.contains("g3"))
- || isBluSeries(thingType);
+ || isBluSeries(thingType) || thingType.startsWith(THING_TYPE_SHELLYBLUGW_STR);
}
public static boolean isBluSeries(String thingType) {
response.getSourceContext().getPeerAddress(), response.getMID(), response.getPayloadString());
}
if (thingHandler.isStopping()) {
- logger.debug("{}: Thing is shutting down, ignore CoIOT message", thingName);
+ logger.debug("{}: Thing is not yet initialized / shutting down, ignore CoIOT message", thingName);
return;
}
}
private void fillRollerFavorites(ShellyDeviceProfile profile, Shelly2GetConfigResult dc) {
- if (dc.sys.uiData.cover != null) {
+ if (dc.sys.uiData.cover != null && !dc.sys.uiData.cover.isEmpty()) {
String[] favorites = dc.sys.uiData.cover.split(",");
profile.settings.favorites = new ArrayList<>();
for (int i = 0; i < favorites.length; i++) {
logger.debug("{}: Device profile re-initialized (thingType={})", thingName, thingType);
}
}
+ } catch (ShellyApiException | RuntimeException e) {
+ logger.debug("{}: Unable to initialize Device Profile", thingName, e);
} finally {
refreshSettings = false;
}
/**
* Tests for {@link ShellyDeviceProfile}.
- *
+ *
* @author Jacob Laursen - Initial contribution
*/
@NonNullByDefault
Arguments.of(THING_TYPE_SHELLYBLUDW_STR, true, true), //
Arguments.of(THING_TYPE_SHELLYBLUMOTION_STR, true, true), //
Arguments.of(THING_TYPE_SHELLYBLUHT_STR, true, true), //
- Arguments.of(THING_TYPE_SHELLYBLUGW_STR, false, false), //
+ Arguments.of(THING_TYPE_SHELLYBLUGW_STR, true, false), //
// Shelly Bulb
Arguments.of(THING_TYPE_SHELLYBULB_STR, false, false), //
// Generation 1