public enum ConfigurationLevel {
EMPTY_CLIENT_ID("@text/conf-error-no-client-id"),
EMPTY_CLIENT_SECRET("@text/conf-error-no-client-secret"),
- REFRESH_TOKEN_NEEDED("@text/conf-error-grant-needed"),
+ REFRESH_TOKEN_NEEDED("@text/conf-error-grant-needed [ \"%s\" ]"),
COMPLETED("");
public String message;
servlet.startListening();
grantServlet = Optional.of(servlet);
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
- ConfigurationLevel.REFRESH_TOKEN_NEEDED.message);
+ ConfigurationLevel.REFRESH_TOKEN_NEEDED.message.formatted(servlet.getPath()));
}
public ApiHandlerConfiguration getConfiguration() {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final HttpService httpService;
+ private final String path;
protected final ApiBridgeHandler handler;
- protected final String path;
public NetatmoServlet(ApiBridgeHandler handler, HttpService httpService, String localPath) {
this.path = BASE_PATH + localPath + "/" + handler.getId();
httpService.unregister(path);
this.destroy();
}
+
+ public String getPath() {
+ return path;
+ }
}
@Override
public void startListening() {
super.startListening();
- URI uri = UriBuilder.fromUri(webHookUrl).path(path + webHookPostfix).build();
+ URI uri = UriBuilder.fromUri(webHookUrl).path(getPath() + webHookPostfix).build();
try {
logger.info("Setting up WebHook at Netatmo to {}", uri.toString());
hookSet = securityApi.addwebhook(uri);
conf-error-no-client-id = Cannot connect to Netatmo bridge as no client id is available in the configuration
conf-error-no-client-secret = Cannot connect to Netatmo bridge as no client secret is available in the configuration
-conf-error-grant-needed = Configuration incomplete, please grant the binding to Netatmo Connect.
+conf-error-grant-needed = Complete the configuration by granting the binding to Netatmo Connect: ''{0}''.
status-bridge-offline = Bridge is not connected to Netatmo API
device-not-connected = Thing is not reachable
data-over-limit = Data seems quite old