mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Remove space before colon (#18023)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
parent
22c7ca99ad
commit
6af04fc31f
@ -111,7 +111,7 @@ public class RoomActions implements ThingActions {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
logger.info("Invalid mode passed : {} - {}", mode, e.getMessage());
|
logger.info("Invalid mode passed: {} - {}", mode, e.getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,6 @@ public class AircareApi extends RestManager {
|
|||||||
return station;
|
return station;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new NetatmoException("Unexpected answer querying device '%s' : not found.", deviceId);
|
throw new NetatmoException("Unexpected answer querying device '%s': not found.", deviceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,14 +65,14 @@ public abstract class RestManager {
|
|||||||
URI uri = uriBuilder.build();
|
URI uri = uriBuilder.build();
|
||||||
T response = apiBridge.executeUri(uri, method, clazz, payload, contentType, 3);
|
T response = apiBridge.executeUri(uri, method, clazz, payload, contentType, 3);
|
||||||
if (response instanceof ApiResponse.Ok apiResponseOk && apiResponseOk.failed()) {
|
if (response instanceof ApiResponse.Ok apiResponseOk && apiResponseOk.failed()) {
|
||||||
throw new NetatmoException("Command failed : %s for uri : %s", response.getStatus(), uri.toString());
|
throw new NetatmoException("Command failed: %s for uri: %s", response.getStatus(), uri.toString());
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static UriBuilder appendParams(UriBuilder builder, @Nullable Object... params) {
|
private static UriBuilder appendParams(UriBuilder builder, @Nullable Object... params) {
|
||||||
if (params.length % 2 != 0) {
|
if (params.length % 2 != 0) {
|
||||||
throw new IllegalArgumentException("appendParams : params count must be even");
|
throw new IllegalArgumentException("appendParams: params count must be even");
|
||||||
}
|
}
|
||||||
for (int i = 0; i < params.length; i += 2) {
|
for (int i = 0; i < params.length; i += 2) {
|
||||||
Object param1 = params[i];
|
Object param1 = params[i];
|
||||||
@ -82,7 +82,7 @@ public abstract class RestManager {
|
|||||||
builder.queryParam(query, param2);
|
builder.queryParam(query, param2);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("appendParams : even parameters must be Strings");
|
throw new IllegalArgumentException("appendParams: even parameters must be Strings");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return builder;
|
return builder;
|
||||||
|
@ -112,7 +112,7 @@ public class SecurityApi extends RestManager {
|
|||||||
try {
|
try {
|
||||||
return get(uriBuilder, Ping.class).getStatus();
|
return get(uriBuilder, Ping.class).getStatus();
|
||||||
} catch (NetatmoException e) {
|
} catch (NetatmoException e) {
|
||||||
logger.debug("Pinging {} failed : {}", vpnUrl, e.getMessage());
|
logger.debug("Pinging {} failed: {}", vpnUrl, e.getMessage());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ public class WeatherApi extends RestManager {
|
|||||||
return station;
|
return station;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new NetatmoException("Unexpected answer searching device '%s' : not found.", deviceId);
|
throw new NetatmoException("Unexpected answer searching device '%s': not found.", deviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -98,7 +98,7 @@ public class WeatherApi extends RestManager {
|
|||||||
return station;
|
return station;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new NetatmoException("Unexpected answer searching device '%s' : not found.", deviceId);
|
throw new NetatmoException("Unexpected answer searching device '%s': not found.", deviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<NAMain> getFavoriteAndGuestStationsData() throws NetatmoException {
|
public Collection<NAMain> getFavoriteAndGuestStationsData() throws NetatmoException {
|
||||||
|
@ -248,8 +248,8 @@ public class NetatmoConstants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Radio signal quality thresholds
|
// Radio signal quality thresholds
|
||||||
static final int[] WIFI_SIGNAL_LEVELS = new int[] { 99, 84, 69, 54 }; // Resp : bad, average, good, full
|
static final int[] WIFI_SIGNAL_LEVELS = new int[] { 99, 84, 69, 54 }; // Resp: bad, average, good, full
|
||||||
static final int[] RADIO_SIGNAL_LEVELS = new int[] { 90, 80, 70, 60 }; // Resp : low, medium, high, full
|
static final int[] RADIO_SIGNAL_LEVELS = new int[] { 90, 80, 70, 60 }; // Resp: low, medium, high, full
|
||||||
|
|
||||||
// Thermostat definitions
|
// Thermostat definitions
|
||||||
public enum SetpointMode {
|
public enum SetpointMode {
|
||||||
|
@ -59,7 +59,7 @@ class NAPushTypeDeserializer implements JsonDeserializer<NAPushType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param apiName : Netatmo Object name (NSD, NACamera...)
|
* @param apiName Netatmo Object name (NSD, NACamera...)
|
||||||
* @return moduletype value if found, or else Unknown
|
* @return moduletype value if found, or else Unknown
|
||||||
*/
|
*/
|
||||||
public static ModuleType fromNetatmoObject(String apiName) {
|
public static ModuleType fromNetatmoObject(String apiName) {
|
||||||
@ -68,7 +68,7 @@ class NAPushTypeDeserializer implements JsonDeserializer<NAPushType> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param apiName : Netatmo Event name (hush, off, on ...)
|
* @param apiName Netatmo Event name (hush, off, on ...)
|
||||||
* @return eventType value if found, or else Unknown
|
* @return eventType value if found, or else Unknown
|
||||||
*/
|
*/
|
||||||
public static EventType fromEvent(String apiName) {
|
public static EventType fromEvent(String apiName) {
|
||||||
|
@ -114,7 +114,7 @@ public class EnergyCapability extends RestCapability<EnergyApi> {
|
|||||||
api.setThermpoint(energyId, roomId, mode, endtime, temp);
|
api.setThermpoint(energyId, roomId, mode, endtime, temp);
|
||||||
handler.expireData();
|
handler.expireData();
|
||||||
} catch (NetatmoException e) {
|
} catch (NetatmoException e) {
|
||||||
logger.warn("Error setting room thermostat mode '{}' : {}", mode, e.getMessage());
|
logger.warn("Error setting room thermostat mode '{}': {}", mode, e.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -154,7 +154,7 @@ public class EnergyCapability extends RestCapability<EnergyApi> {
|
|||||||
}
|
}
|
||||||
handler.expireData();
|
handler.expireData();
|
||||||
} catch (NetatmoException e) {
|
} catch (NetatmoException e) {
|
||||||
logger.warn("Error handling command '{}' : {}", command, e.getMessage());
|
logger.warn("Error handling command '{}': {}", command, e.getMessage());
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
logger.warn("Command '{}' sent to channel '{}' is not a valid setpoint mode.", command, channelName);
|
logger.warn("Command '{}' sent to channel '{}' is not a valid setpoint mode.", command, channelName);
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ class SecurityCapability extends RestCapability<SecurityApi> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (NetatmoException e) {
|
} catch (NetatmoException e) {
|
||||||
logger.warn("Error retrieving last events for home '{}' : {}", securityId, e.getMessage());
|
logger.warn("Error retrieving last events for home '{}': {}", securityId, e.getMessage());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ class SecurityCapability extends RestCapability<SecurityApi> {
|
|||||||
try {
|
try {
|
||||||
return api.getDeviceEvents(securityId, moduleId, deviceType);
|
return api.getDeviceEvents(securityId, moduleId, deviceType);
|
||||||
} catch (NetatmoException e) {
|
} catch (NetatmoException e) {
|
||||||
logger.warn("Error retrieving last events of camera '{}' : {}", moduleId, e.getMessage());
|
logger.warn("Error retrieving last events of camera '{}': {}", moduleId, e.getMessage());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}).orElse(List.of()));
|
}).orElse(List.of()));
|
||||||
@ -193,7 +193,7 @@ class SecurityCapability extends RestCapability<SecurityApi> {
|
|||||||
try {
|
try {
|
||||||
return api.getPersonEvents(securityId, personId);
|
return api.getPersonEvents(securityId, personId);
|
||||||
} catch (NetatmoException e) {
|
} catch (NetatmoException e) {
|
||||||
logger.warn("Error retrieving last events of person '{}' : {}", personId, e.getMessage());
|
logger.warn("Error retrieving last events of person '{}': {}", personId, e.getMessage());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}).orElse(List.of()));
|
}).orElse(List.of()));
|
||||||
@ -205,7 +205,7 @@ class SecurityCapability extends RestCapability<SecurityApi> {
|
|||||||
api.setPersonAwayStatus(securityId, personId, away);
|
api.setPersonAwayStatus(securityId, personId, away);
|
||||||
handler.expireData();
|
handler.expireData();
|
||||||
} catch (NetatmoException e) {
|
} catch (NetatmoException e) {
|
||||||
logger.warn("Error setting person away/at home '{}' : {}", personId, e.getMessage());
|
logger.warn("Error setting person away/at home '{}': {}", personId, e.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ class SecurityCapability extends RestCapability<SecurityApi> {
|
|||||||
api.changeStatus(localURL, status);
|
api.changeStatus(localURL, status);
|
||||||
handler.expireData();
|
handler.expireData();
|
||||||
} catch (NetatmoException e) {
|
} catch (NetatmoException e) {
|
||||||
logger.warn("Error changing camera monitoring status '{}' : {}", status, e.getMessage());
|
logger.warn("Error changing camera monitoring status '{}': {}", status, e.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -235,7 +235,7 @@ class SecurityCapability extends RestCapability<SecurityApi> {
|
|||||||
api.changeFloodLightMode(securityId, cameraId, mode);
|
api.changeFloodLightMode(securityId, cameraId, mode);
|
||||||
handler.expireData();
|
handler.expireData();
|
||||||
} catch (NetatmoException e) {
|
} catch (NetatmoException e) {
|
||||||
logger.warn("Error changing Presence floodlight mode '{}' : {}", mode, e.getMessage());
|
logger.warn("Error changing Presence floodlight mode '{}': {}", mode, e.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ public class NetatmoThingTypeProvider implements ThingTypeProvider {
|
|||||||
return localizationService.createLocalizedThingType(bundle,
|
return localizationService.createLocalizedThingType(bundle,
|
||||||
moduleType.isABridge() ? thingTypeBuilder.buildBridge() : thingTypeBuilder.build(), locale);
|
moduleType.isABridge() ? thingTypeBuilder.buildBridge() : thingTypeBuilder.build(), locale);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
logger.warn("Unable to define ModuleType for thingType {} : {}", thingTypeUID.getId(), e.getMessage());
|
logger.warn("Unable to define ModuleType for thingType {}: {}", thingTypeUID.getId(), e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -93,7 +93,7 @@ public class GrantServlet extends NetatmoServlet {
|
|||||||
resp.getWriter().append(replaceKeysFromMap(accountTemplate, replaceMap));
|
resp.getWriter().append(replaceKeysFromMap(accountTemplate, replaceMap));
|
||||||
resp.getWriter().close();
|
resp.getWriter().close();
|
||||||
} else {
|
} else {
|
||||||
logger.warn("Unexpected : requestUrl is null");
|
logger.warn("Unexpected: requestUrl is null");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,9 +71,9 @@ public class WebhookServlet extends NetatmoServlet {
|
|||||||
logger.info("Setting up WebHook at Netatmo to {}", uri.toString());
|
logger.info("Setting up WebHook at Netatmo to {}", uri.toString());
|
||||||
hookSet = securityApi.addwebhook(uri);
|
hookSet = securityApi.addwebhook(uri);
|
||||||
} catch (UriBuilderException e) {
|
} catch (UriBuilderException e) {
|
||||||
logger.info("webhookUrl is not a valid URI '{}' : {}", uri, e.getMessage());
|
logger.info("webhookUrl is not a valid URI '{}': {}", uri, e.getMessage());
|
||||||
} catch (NetatmoException e) {
|
} catch (NetatmoException e) {
|
||||||
logger.info("Error setting webhook : {}", e.getMessage());
|
logger.info("Error setting webhook: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ public class WebhookServlet extends NetatmoServlet {
|
|||||||
securityApi.dropWebhook();
|
securityApi.dropWebhook();
|
||||||
hookSet = false;
|
hookSet = false;
|
||||||
} catch (NetatmoException e) {
|
} catch (NetatmoException e) {
|
||||||
logger.warn("Error releasing webhook : {}", e.getMessage());
|
logger.warn("Error releasing webhook: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
super.dispose();
|
super.dispose();
|
||||||
@ -99,12 +99,12 @@ public class WebhookServlet extends NetatmoServlet {
|
|||||||
|
|
||||||
private void processEvent(String data) throws IOException {
|
private void processEvent(String data) throws IOException {
|
||||||
if (!data.isEmpty()) {
|
if (!data.isEmpty()) {
|
||||||
logger.debug("Event transmitted from restService : {}", data);
|
logger.debug("Event transmitted from restService: {}", data);
|
||||||
try {
|
try {
|
||||||
WebhookEvent event = deserializer.deserialize(WebhookEvent.class, data);
|
WebhookEvent event = deserializer.deserialize(WebhookEvent.class, data);
|
||||||
notifyListeners(event);
|
notifyListeners(event);
|
||||||
} catch (NetatmoException e) {
|
} catch (NetatmoException e) {
|
||||||
logger.debug("Error deserializing webhook data received : {}. {}", data, e.getMessage());
|
logger.debug("Error deserializing webhook data received: {}. {}", data, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user