[weathercompany] Internationalization of discovery result (#11486)

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2021-11-01 19:32:51 +01:00 committed by GitHub
parent 745bf76569
commit a75ef85ece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -42,7 +42,6 @@ import org.slf4j.LoggerFactory;
public class WeatherCompanyDiscoveryService extends AbstractDiscoveryService {
// Thing for local weather created during discovery
private static final String LOCAL = "local";
private static final String LOCAL_WEATHER = "Local Forecast";
private static final int DISCOVER_TIMEOUT_SECONDS = 4;
private static final int DISCOVERY_INTERVAL_SECONDS = 1200;
@ -119,7 +118,7 @@ public class WeatherCompanyDiscoveryService extends AbstractDiscoveryService {
properties.put(CONFIG_LANGUAGE, WeatherCompanyAbstractHandler.lookupLanguage(localeProvider.getLocale()));
ThingUID bridgeUID = bridgeHandler.getThing().getUID();
ThingUID localWeatherThing = new ThingUID(THING_TYPE_WEATHER_FORECAST, bridgeUID, LOCAL);
thingDiscovered(DiscoveryResultBuilder.create(localWeatherThing).withBridge(bridgeUID).withLabel(LOCAL_WEATHER)
.withProperties(properties).build());
thingDiscovered(DiscoveryResultBuilder.create(localWeatherThing).withBridge(bridgeUID)
.withLabel("@text/discovery.weather-forecast.local.label").withProperties(properties).build());
}
}

View File

@ -256,3 +256,7 @@ offline.comm-error-timeout = TimeoutException: Call to Weather Company API timed
offline.comm-error-parsing-daily-forecast = Error parsing daily forecast
offline.comm-error-parsing-daypart-forecast = Error parsing daypart forecast
offline.comm-error-parsing-pws-forecast = Error parsing PWS observations
# discovery result
discovery.weather-forecast.local.label = Local Forecast