diff --git a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVBridgeHandler.java b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVBridgeHandler.java index 486098088..f39e85b9c 100644 --- a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVBridgeHandler.java +++ b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVBridgeHandler.java @@ -76,7 +76,7 @@ public class OpenUVBridgeHandler extends BaseBridgeHandler { BridgeConfiguration config = getConfigAs(BridgeConfiguration.class); if (config.apikey.isEmpty()) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "Parameter 'apikey' must be configured."); + "@text/offline.config-error-unknown-apikey"); return; } header.put("x-access-token", config.apikey); @@ -127,9 +127,8 @@ public class OpenUVBridgeHandler extends BaseBridgeHandler { LocalDate tomorrow = today.plusDays(1); LocalDateTime tomorrowMidnight = tomorrow.atStartOfDay().plusMinutes(2); - String message = "Quota Exceeded, going OFFLINE for today, will retry at : " - + tomorrowMidnight.toString(); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, message); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, String + .format("@text/offline.comm-error-quota-exceeded [ \"%s\" ]", tomorrowMidnight.toString())); reconnectJob = scheduler.schedule(this::initiateConnexion, Duration.between(LocalDateTime.now(), tomorrowMidnight).toMinutes(), TimeUnit.MINUTES); diff --git a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVReportHandler.java b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVReportHandler.java index c92d71450..7a8488ebc 100644 --- a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVReportHandler.java +++ b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVReportHandler.java @@ -86,11 +86,11 @@ public class OpenUVReportHandler extends BaseThingHandler { if (config.refresh < 3) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "Parameter 'refresh' must be higher than 3 minutes to stay in free API plan"); + "@text/offline.config-error-invalid-refresh"); } else { Bridge bridge = getBridge(); if (bridge == null) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Invalid bridge"); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED); } else { bridgeHandler = (OpenUVBridgeHandler) bridge.getHandler(); updateStatus(ThingStatus.UNKNOWN); diff --git a/bundles/org.openhab.binding.openuv/src/main/resources/OH-INF/i18n/openuv.properties b/bundles/org.openhab.binding.openuv/src/main/resources/OH-INF/i18n/openuv.properties new file mode 100644 index 000000000..f0fdd2f9a --- /dev/null +++ b/bundles/org.openhab.binding.openuv/src/main/resources/OH-INF/i18n/openuv.properties @@ -0,0 +1,66 @@ +# binding + +binding.openuv.name = OpenUV Binding +binding.openuv.description = Global Real-Time UV Index Forecast API + +# thing types + +thing-type.openuv.openuvapi.label = Open UV API +thing-type.openuv.openuvapi.description = Bridge to the OpenUV Project API. In order to receive the data, you must register an account on https://www.openuv.io/auth/google and get your API token. +thing-type.openuv.uvreport.label = UV Report +thing-type.openuv.uvreport.description = Provides various UV data from the OpenUV Project for a given location. + +# thing types config + +thing-type.config.openuv.openuvapi.apikey.label = API Key +thing-type.config.openuv.openuvapi.apikey.description = Data-platform token to access the OpenUV API service +thing-type.config.openuv.uvreport.location.label = Location +thing-type.config.openuv.uvreport.location.description = Your geo coordinates separated with comma (e.g. "37.8,-122.4,177"). +thing-type.config.openuv.uvreport.refresh.label = Refresh Interval +thing-type.config.openuv.uvreport.refresh.description = Specifies the refresh interval in minutes. + +# channel types + +channel-type.openuv.Alert.label = UV Alert +channel-type.openuv.Alert.state.option.0 = Low +channel-type.openuv.Alert.state.option.1 = Medium +channel-type.openuv.Alert.state.option.2 = High +channel-type.openuv.Alert.state.option.3 = Very high +channel-type.openuv.Alert.state.option.4 = Extreme +channel-type.openuv.Ozone.label = Ozone +channel-type.openuv.Ozone.description = Ozone level from OMI data +channel-type.openuv.SafeExposure.label = Safe Exposure +channel-type.openuv.SafeExposure.description = Safe exposure duration for Fitzpatrick Skin Types. +channel-type.openuv.UVColor.label = Alert Color +channel-type.openuv.UVColor.description = Color associated to given UV Index alert level. +channel-type.openuv.UVIndex.label = UV Index +channel-type.openuv.UVIndex.description = UV Index +channel-type.openuv.UVMax.label = UV Max +channel-type.openuv.UVMax.description = Max UV Index for the day (at solar noon) +channel-type.openuv.UVMaxEvent.label = UV Max Event +channel-type.openuv.UVMaxEvent.description = Triggers when current UV Index reaches maximum of the day +channel-type.openuv.elevation.label = Elevation +channel-type.openuv.elevation.description = The elevation of the sun (should FOLLOW appropriate item). +channel-type.openuv.timestamp.label = Timestamp +channel-type.openuv.timestamp.state.pattern = %1$tF %1$tR + +# channel types config + +channel-type.config.openuv.SafeExposure.index.label = Skin Type +channel-type.config.openuv.SafeExposure.index.description = Fitzpatrick Skin Type. +channel-type.config.openuv.SafeExposure.index.option.I = Pale +channel-type.config.openuv.SafeExposure.index.option.II = White +channel-type.config.openuv.SafeExposure.index.option.III = Light brown +channel-type.config.openuv.SafeExposure.index.option.IV = Moderate brown +channel-type.config.openuv.SafeExposure.index.option.V = Dark brown +channel-type.config.openuv.SafeExposure.index.option.VI = Black + +# Thing status descriptions + +offline.config-error-unknown-apikey = Parameter 'apikey' must be configured. +offline.config-error-invalid-refresh = Parameter 'refresh' must be higher than 3 minutes to stay in free API plan. +offline.comm-error-quota-exceeded = Quota Exceeded, going OFFLINE for today, will retry at : {0} + +# Discovery result + +discovery.openuv.uvreport.local.label = Local UV Report diff --git a/bundles/org.openhab.binding.openuv/src/main/resources/OH-INF/i18n/openuv_fr.properties b/bundles/org.openhab.binding.openuv/src/main/resources/OH-INF/i18n/openuv_fr.properties index feae5c187..48a1673eb 100644 --- a/bundles/org.openhab.binding.openuv/src/main/resources/OH-INF/i18n/openuv_fr.properties +++ b/bundles/org.openhab.binding.openuv/src/main/resources/OH-INF/i18n/openuv_fr.properties @@ -1,10 +1,11 @@ # binding + binding.openuv.name = Extension OpenUV binding.openuv.description = Service de prévision globale de l'indice UV en temps réel. # thing types + thing-type.openuv.openuvapi.label = Bridge OpenUV thing-type.openuv.openuvapi.description = Passerelle vers le service du projet OpenUV. Pour recevoir des données vous devez créer votre compte à l'adresse https://www.openuv.io/auth/google et obtenir votre clef API. - thing-type.openuv.uvreport.label = Rapport UV thing-type.openuv.uvreport.description = Fournit diverses information pour un emplacement donnée.