using maxVals is now supported

This commit is contained in:
Dorian Zedler 2019-07-13 20:05:46 +02:00
parent 01bb8fc51b
commit 3a1d29299d
2 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ class BlueWeather {
this.log("init done", 2)
}
getLocationData(locId, range = {from:"", to:""}, async, processingFunction, errorFunction) {
getLocationData(locId, range = {from:"", to:""}, maxVals = 0, async, processingFunction, errorFunction) {
this.xhttp.abort()
var thisObject = this
@ -32,7 +32,7 @@ class BlueWeather {
};
}
var url = "https://api.itsblue.de/weather/json.php?locId="+locId+"&range[from]="+range.from + "&range[to]="+range.to
var url = "https://api.itsblue.de/weather/json.php?locId="+locId+"&range[from]="+range.from + "&range[to]="+range.to + "&maxVals=" + maxVals
this.log("starting location request; URL is: " + url, 3)
this.xhttp.open("GET", url, async)
this.xhttp.send()

View file

@ -24,7 +24,7 @@ class BlueWeatherDashboard {
// set page to loading state
mainContent.innerHTML = "<div class=\"d-flex justify-content-center\"><div class=\"spinner-border\" role=\"status\"><span class=\"sr-only\">Loading...</span></div></div>"
this.blueweather.getLocationData(this.loc, undefined, true, function (locationData) {
this.blueweather.getLocationData(this.loc, undefined, undefined, true, function (locationData) {
// refresh sensors list
dashboard.loadSensors(locationData.sensors)
@ -56,7 +56,7 @@ class BlueWeatherDashboard {
to = new Date().getTime() / 1000 - parseInt(to)
}
this.blueweather.getLocationData(this.loc, { from: from, to: to }, true, function (locationData) {
this.blueweather.getLocationData(this.loc, { from: from, to: to }, undefined, true, function (locationData) {
dashboard.loadDiagram("mainContent", locationData, dashboard.currentPage)
})