Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
Initial contribution of OpenWeatherMap binding (#5694)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Weitkamp <[email protected]>
  • Loading branch information
cweitkamp authored and kaikreuzer committed Nov 14, 2018
1 parent 3807949 commit 75305c1
Show file tree
Hide file tree
Showing 48 changed files with 4,020 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/_includes/documentation-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<li><a href="{{docu}}/features/bindings/mqttgeneric/readme.html">MQTT Generic</a></li>
<li><a href="{{docu}}/features/bindings/ntp/readme.html">NTP Time Server</a></li>
<li><a href="{{docu}}/features/bindings/onewire/readme.html">OneWire</a></li>
<li><a href="{{docu}}/features/bindings/openweathermap/readme.html">OpenWeatherMap</a></li>
<li><a href="{{docu}}/features/bindings/hue/readme.html">Philips Hue</a></li>
<li><a href="{{docu}}/features/bindings/serialbutton/readme.html">Serial Button</a></li>
<li><a href="{{docu}}/features/bindings/sonos/readme.html">Sonos</a></li>
Expand Down
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>
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>
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>
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>
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
Loading

0 comments on commit 75305c1

Please sign in to comment.