Skip to content

Commit

Permalink
Remove space before colon (#18023)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Laursen <[email protected]>
  • Loading branch information
jlaur authored Jan 2, 2025
1 parent 22c7ca9 commit 6af04fc
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void setThermRoomModeSetpoint(
return;
}
} catch (IllegalArgumentException e) {
logger.info("Invalid mode passed : {} - {}", mode, e.getMessage());
logger.info("Invalid mode passed: {} - {}", mode, e.getMessage());
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ public NAMain getHomeCoach(String deviceId) throws NetatmoException {
return station;
}
}
throw new NetatmoException("Unexpected answer querying device '%s' : not found.", deviceId);
throw new NetatmoException("Unexpected answer querying device '%s': not found.", deviceId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ private <T extends ApiResponse<?>> T executeUri(UriBuilder uriBuilder, HttpMetho
URI uri = uriBuilder.build();
T response = apiBridge.executeUri(uri, method, clazz, payload, contentType, 3);
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;
}

private static UriBuilder appendParams(UriBuilder builder, @Nullable Object... params) {
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) {
Object param1 = params[i];
Expand All @@ -82,7 +82,7 @@ private static UriBuilder appendParams(UriBuilder builder, @Nullable Object... p
builder.queryParam(query, param2);
}
} else {
throw new IllegalArgumentException("appendParams : even parameters must be Strings");
throw new IllegalArgumentException("appendParams: even parameters must be Strings");
}
}
return builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public List<HomeEvent> getDeviceEvents(String homeId, String deviceId, String de
try {
return get(uriBuilder, Ping.class).getStatus();
} catch (NetatmoException e) {
logger.debug("Pinging {} failed : {}", vpnUrl, e.getMessage());
logger.debug("Pinging {} failed: {}", vpnUrl, e.getMessage());
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public NAMain getStationData(String deviceId) throws NetatmoException {
return station;
}
}
throw new NetatmoException("Unexpected answer searching device '%s' : not found.", deviceId);
throw new NetatmoException("Unexpected answer searching device '%s': not found.", deviceId);
}

/**
Expand All @@ -98,7 +98,7 @@ public NAMain getOwnedStationData(String deviceId) throws NetatmoException {
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ public enum FeatureArea {
}

// Radio signal quality thresholds
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[] 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

// Thermostat definitions
public enum SetpointMode {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
public static ModuleType fromNetatmoObject(String apiName) {
Expand All @@ -68,7 +68,7 @@ public static ModuleType fromNetatmoObject(String apiName) {
}

/**
* @param apiName : Netatmo Event name (hush, off, on ...)
* @param apiName Netatmo Event name (hush, off, on ...)
* @return eventType value if found, or else Unknown
*/
public static EventType fromEvent(String apiName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void setThermPoint(String roomId, SetpointMode mode, long endtime, double
api.setThermpoint(energyId, roomId, mode, endtime, temp);
handler.expireData();
} catch (NetatmoException e) {
logger.warn("Error setting room thermostat mode '{}' : {}", mode, e.getMessage());
logger.warn("Error setting room thermostat mode '{}': {}", mode, e.getMessage());
}
});
}
Expand Down Expand Up @@ -154,7 +154,7 @@ public void handleCommand(String channelName, Command command) {
}
handler.expireData();
} catch (NetatmoException e) {
logger.warn("Error handling command '{}' : {}", command, e.getMessage());
logger.warn("Error handling command '{}': {}", command, e.getMessage());
} catch (IllegalArgumentException e) {
logger.warn("Command '{}' sent to channel '{}' is not a valid setpoint mode.", command, channelName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected List<NAObject> updateReadings(SecurityApi api) {
}
});
} 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;
}
Expand Down Expand Up @@ -182,7 +182,7 @@ private Collection<HomeEvent> requestDeviceEvents(String moduleId, String device
try {
return api.getDeviceEvents(securityId, moduleId, deviceType);
} 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;
}
}).orElse(List.of()));
Expand All @@ -193,7 +193,7 @@ private Collection<HomeEvent> requestPersonEvents(String personId) {
try {
return api.getPersonEvents(securityId, personId);
} 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;
}
}).orElse(List.of()));
Expand All @@ -205,7 +205,7 @@ public void setPersonAway(String personId, boolean away) {
api.setPersonAwayStatus(securityId, personId, away);
handler.expireData();
} 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());
}
});
}
Expand All @@ -224,7 +224,7 @@ public void changeStatus(@Nullable String localURL, boolean status) {
api.changeStatus(localURL, status);
handler.expireData();
} catch (NetatmoException e) {
logger.warn("Error changing camera monitoring status '{}' : {}", status, e.getMessage());
logger.warn("Error changing camera monitoring status '{}': {}", status, e.getMessage());
}
});
}
Expand All @@ -235,7 +235,7 @@ public void changeFloodlightMode(String cameraId, FloodLightMode mode) {
api.changeFloodLightMode(securityId, cameraId, mode);
handler.expireData();
} catch (NetatmoException e) {
logger.warn("Error changing Presence floodlight mode '{}' : {}", mode, e.getMessage());
logger.warn("Error changing Presence floodlight mode '{}': {}", mode, e.getMessage());
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public Collection<ThingType> getThingTypes(@Nullable Locale locale) {
return localizationService.createLocalizedThingType(bundle,
moduleType.isABridge() ? thingTypeBuilder.buildBridge() : thingTypeBuilder.build(), locale);
} 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se
resp.getWriter().append(replaceKeysFromMap(accountTemplate, replaceMap));
resp.getWriter().close();
} else {
logger.warn("Unexpected : requestUrl is null");
logger.warn("Unexpected: requestUrl is null");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public void startListening() {
logger.info("Setting up WebHook at Netatmo to {}", uri.toString());
hookSet = securityApi.addwebhook(uri);
} 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) {
logger.info("Error setting webhook : {}", e.getMessage());
logger.info("Error setting webhook: {}", e.getMessage());
}
}

Expand All @@ -85,7 +85,7 @@ public void dispose() {
securityApi.dropWebhook();
hookSet = false;
} catch (NetatmoException e) {
logger.warn("Error releasing webhook : {}", e.getMessage());
logger.warn("Error releasing webhook: {}", e.getMessage());
}
}
super.dispose();
Expand All @@ -99,12 +99,12 @@ protected void service(HttpServletRequest req, HttpServletResponse resp) throws

private void processEvent(String data) throws IOException {
if (!data.isEmpty()) {
logger.debug("Event transmitted from restService : {}", data);
logger.debug("Event transmitted from restService: {}", data);
try {
WebhookEvent event = deserializer.deserialize(WebhookEvent.class, data);
notifyListeners(event);
} catch (NetatmoException e) {
logger.debug("Error deserializing webhook data received : {}. {}", data, e.getMessage());
logger.debug("Error deserializing webhook data received: {}. {}", data, e.getMessage());
}
}
}
Expand Down

0 comments on commit 6af04fc

Please sign in to comment.