Use official writing of OpenWeatherMap
Short documentation on how to get a OWN API keymaster
parent
970c344c11
commit
a256bbed00
|
|
@ -1,12 +1,12 @@
|
|||
# Open Weather Map weather provider
|
||||
# OpenWeatherMap weather provider
|
||||
|
||||
This updates [Weather](https://banglejs.com/apps/#weather) with data from the Open Weather Map API
|
||||
This updates [Weather](https://banglejs.com/apps/#weather) with data from the OpenWeatherMap API
|
||||
|
||||
## Usage
|
||||
|
||||
Just install and configure the app. This needs an internet-enabled Gadgetbridge version.
|
||||
Install [My Location](https://banglejs.com/apps/#mylocation) to change the location for the weather requests.
|
||||
Install one of the text input libraries to modify the API key in the settings
|
||||
Install one of the text input libraries to set the API key in the app settings or use the web interface.
|
||||
|
||||
## Creator
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,27 @@
|
|||
<link rel="stylesheet" href="../../css/spectre.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<h3>Set OWM API key</h3>
|
||||
<p><input id="apikey" style="width:90%;"></input></p>
|
||||
<p><button id="upload" class="btn btn-primary">Set</button></p>
|
||||
<h3>Set OpenWeatherMap (OWM) API key</h3>
|
||||
<p><input id="apikey" onkeyup="checkInput()" style="width:90%; margin: 3px"></input><button id="upload" class="btn btn-primary">Save key</button></p>
|
||||
|
||||
<h4>Where to get your personal API key?</h4>
|
||||
<p>Go to <a href="https://home.openweathermap.org/users/sign_up">https://home.openweathermap.org/users/sign_up</a> and sign up for a free account.<br>
|
||||
After registration you can login and optain your personal API key.</p>
|
||||
|
||||
|
||||
<script src="../../core/lib/interface.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
function checkInput() {
|
||||
if(document.getElementById("apikey").value==="") {
|
||||
document.getElementById('upload').disabled = true;
|
||||
} else {
|
||||
document.getElementById('upload').disabled = false;
|
||||
}
|
||||
}
|
||||
checkInput();
|
||||
|
||||
var settings = {};
|
||||
function onInit(){
|
||||
console.log("Loading settings from BangleJs...");
|
||||
|
|
@ -20,6 +34,7 @@
|
|||
console.log("Got settings", settings);
|
||||
document.getElementById("apikey").value = settings.apikey;
|
||||
console.log("Loaded apikey from BangleJs.");
|
||||
checkInput();
|
||||
}
|
||||
});
|
||||
} catch(ex) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{ "id": "owmweather",
|
||||
"name": "Open Weather Map weather provider",
|
||||
"name": "OpenWeatherMap weather provider",
|
||||
"shortName":"OWM Weather",
|
||||
"version":"0.01",
|
||||
"description": "Pulls weather from OWM API",
|
||||
"description": "Pulls weather from OpenWeatherMap (OWM) API",
|
||||
"icon": "app.png",
|
||||
"type": "bootloader",
|
||||
"tags": "boot,tool,weather",
|
||||
|
|
|
|||
Loading…
Reference in New Issue