зеркало из https://github.com/mozilla/smarthome.git
updated yahoo weather thing type definition
- changed type of parameter location from text to integer - added min attribute for refresh parameter Signed-off-by: Thomas Höfer <t.hoefer@telekom.de>
This commit is contained in:
Родитель
5ae012c245
Коммит
dd0f652a77
|
@ -1,3 +1,3 @@
|
|||
yahooweather:weather:berlin [ location="638242" ]
|
||||
yahooweather:weather:losangeles "Los Angeles" [ location="2442047", unit="us", refresh=120 ]
|
||||
yahooweather:weather:berlin [ location=638242 ]
|
||||
yahooweather:weather:losangeles "Los Angeles" [ location=2442047, refresh=120 ]
|
||||
|
||||
|
|
|
@ -16,13 +16,13 @@
|
|||
</channels>
|
||||
|
||||
<config-description>
|
||||
<parameter name="location" type="text" required="true">
|
||||
<parameter name="location" type="integer" required="true">
|
||||
<label>Location</label>
|
||||
<description>Location for the weather information.
|
||||
Syntax is WOEID, see https://en.wikipedia.org/wiki/WOEID.
|
||||
</description>
|
||||
</parameter>
|
||||
<parameter name="refresh" type="integer">
|
||||
<parameter name="refresh" type="integer" min="1">
|
||||
<label>Refresh interval</label>
|
||||
<description>Specifies the refresh interval in seconds.</description>
|
||||
<default>60</default>
|
||||
|
|
|
@ -51,7 +51,7 @@ public class YahooWeatherHandler extends ConfigStatusThingHandler {
|
|||
|
||||
private final Logger logger = LoggerFactory.getLogger(YahooWeatherHandler.class);
|
||||
|
||||
private String location;
|
||||
private BigDecimal location;
|
||||
private BigDecimal refresh;
|
||||
|
||||
private String weatherData = null;
|
||||
|
@ -69,7 +69,7 @@ public class YahooWeatherHandler extends ConfigStatusThingHandler {
|
|||
|
||||
Configuration config = getThing().getConfiguration();
|
||||
|
||||
location = (String) config.get("location");
|
||||
location = (BigDecimal) config.get("location");
|
||||
|
||||
try {
|
||||
refresh = (BigDecimal) config.get("refresh");
|
||||
|
|
Загрузка…
Ссылка в новой задаче