This repository has been archived by the owner on May 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial contribution of OpenWeatherMap binding (#5694)
Signed-off-by: Christoph Weitkamp <[email protected]>
- Loading branch information
1 parent
3807949
commit 75305c1
Showing
48 changed files
with
4,020 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
extensions/binding/org.eclipse.smarthome.binding.openweathermap/.classpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src/main/java"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
33 changes: 33 additions & 0 deletions
33
extensions/binding/org.eclipse.smarthome.binding.openweathermap/.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.eclipse.smarthome.binding.openweathermap</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ds.core.builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
10 changes: 10 additions & 0 deletions
10
extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/binding/binding.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<binding:binding id="openweathermap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" | ||
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> | ||
|
||
<name>OpenWeatherMap Binding</name> | ||
<description>OpenWeatherMap - Current weather and forecasts in your city.</description> | ||
<author>Christoph Weitkamp</author> | ||
|
||
</binding:binding> |
78 changes: 78 additions & 0 deletions
78
extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/config/config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<config-description:config-descriptions | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:config-description="http://eclipse.org/smarthome/schemas/config-description/v1.0.0" | ||
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/config-description/v1.0.0 http://eclipse.org/smarthome/schemas/config-description-1.0.0.xsd"> | ||
|
||
<!-- Config for OpenWeatherMap Binding --> | ||
<config-description uri="bridge-type:openweathermap:weather-api"> | ||
<parameter name="apikey" type="text" required="true"> | ||
<context>password</context> | ||
<label>API Key</label> | ||
<description>API key to access the OpenWeatherMap API.</description> | ||
</parameter> | ||
<parameter name="refreshInterval" type="integer" min="10" unit="min"> | ||
<label>Refresh Interval</label> | ||
<description>Specifies the refresh interval (in minutes).</description> | ||
<default>60</default> | ||
</parameter> | ||
<parameter name="language" type="text"> | ||
<label>Language</label> | ||
<description>Language to be used by the OpenWeatherMap API.</description> | ||
<options> | ||
<option value="ar">Arabic</option> | ||
<option value="bg">Bulgarian</option> | ||
<option value="ca">Catalan</option> | ||
<option value="zh_cn">Chinese - Simplified</option> | ||
<option value="zh_tw">Chinese - Traditional</option> | ||
<option value="hr">Croatian</option> | ||
<option value="cz">Czech</option> | ||
<option value="nl">Dutch</option> | ||
<option value="en">English</option> | ||
<option value="fi">Finnish</option> | ||
<option value="fr">French</option> | ||
<option value="gl">Galician</option> | ||
<option value="de">German</option> | ||
<option value="el">Greek</option> | ||
<option value="hu">Hungarian</option> | ||
<option value="it">Italian</option> | ||
<option value="ja">Japanese</option> | ||
<option value="kr">Korean</option> | ||
<option value="la">Latvian</option> | ||
<option value="lt">Lithuanian</option> | ||
<option value="mk">Macedonian</option> | ||
<option value="fa">Persian (Farsi)</option> | ||
<option value="pl">Polish</option> | ||
<option value="pt">Portuguese</option> | ||
<option value="ro">Romanian</option> | ||
<option value="ru">Russian</option> | ||
<option value="sk">Slovak</option> | ||
<option value="sl">Slovenian</option> | ||
<option value="es">Spanish</option> | ||
<option value="sw">Swedish</option> | ||
<option value="tr">Turkish</option> | ||
<option value="ua">Ukrainian</option> | ||
<option value="vi">Vietnamese</option> | ||
</options> | ||
</parameter> | ||
</config-description> | ||
|
||
<config-description uri="thing-type:openweathermap:weather-and-forecast"> | ||
<parameter name="location" type="text" required="true"> | ||
<context>location</context> | ||
<label>Location of Weather</label> | ||
<description>Location of weather in geographical coordinates (latitude/longitude/altitude).</description> | ||
</parameter> | ||
<parameter name="forecastHours" type="integer" min="0" max="120" step="3"> | ||
<label>Number of Hours</label> | ||
<description>Number of hours for hourly forecast.</description> | ||
<default>24</default> | ||
</parameter> | ||
<parameter name="forecastDays" type="integer" min="0" max="16" step="1"> | ||
<label>Number of Days</label> | ||
<description>Number of days for daily forecast.</description> | ||
<default>6</default> | ||
</parameter> | ||
</config-description> | ||
|
||
</config-description:config-descriptions> |
13 changes: 13 additions & 0 deletions
13
...nding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/i18n/openweathermap.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# thing status | ||
offline.conf-error-missing-apikey = The 'apikey' parameter must be configured. | ||
offline.conf-error-invalid-apikey = Invalid API key. Please see https://openweathermap.org/faq#error401 for more info. | ||
offline.conf-error-not-supported-refreshInterval = The 'refreshInterval' parameter must be at least 10 minutes. | ||
offline.conf-error-not-supported-language = The given 'language' parameter is not supported. | ||
|
||
offline.conf-error-missing-location = The 'location' parameter must be configured. | ||
offline.conf-error-parsing-location = The 'location' parameter could not be split into latitude and longitude. | ||
offline.conf-error-not-supported-number-of-hours = The 'forecastHours' parameter must be between 0 and 120 - increment 3. | ||
offline.conf-error-not-supported-number-of-days = The 'forecastDays' parameter must be between 0 and 16. | ||
|
||
# discovery result | ||
discovery.openweathermap.weather-and-forecast.api.local.label = Local Weather And Forecast |
Oops, something went wrong.