Skip to content

Commit

Permalink
variEnergy 1.0.2
Browse files Browse the repository at this point in the history
1.0.2
- check on existance of data
  • Loading branch information
oepi-loepi committed Apr 30, 2023
1 parent 4d14733 commit e6363cc
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.0.2
- check on existance of data

1.0.1
- first

31 changes: 29 additions & 2 deletions VariEnergyApp.qml
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,19 @@ App {
var JsonString = xhr.responseText
var JsonObject= JSON.parse(JsonString)
var priceVari
for (var a in JsonObject.Prices){
for (var i = 0; i < 24; i++) {
if(JsonObject.Prices[i]){
priceVari = JsonObject.Prices[i].price
}else{
priceVari = 0
}
pricesToday10.push(priceVari*10)
}
/* for (var a in JsonObject.Prices){
priceVari = JsonObject.Prices[a].price
pricesToday10.push(priceVari*10)
}
*/
if (debugOutput) console.log("*********variEnergy pricesToday10 getVaripricesToday: " + JSON.stringify(pricesToday10));
valuesUpdated()
}
Expand Down Expand Up @@ -204,12 +213,30 @@ App {
var JsonString = xhr.responseText
var JsonObject= JSON.parse(JsonString)
var priceVari
for (var a in JsonObject.Prices)
for (var i = 0; i < 24; i++) {
if (debugOutput) console.log("*********variEnergy xhr.responseText checking : " + "Prices["+i+"].price")
if(JsonObject.Prices[i]){
if (debugOutput) console.log("*********variEnergy found : " + "Prices["+i+"].price")
priceVari = JsonObject.Prices[i].price
}else{
if (debugOutput) console.log("*********variEnergy not found : " + "Prices["+i+"].price")
priceVari = 0
}
prices.push(priceVari)
prices10.push(priceVari*10)
}

/* for (var a in JsonObject.Prices)
{
priceVari = JsonObject.Prices[a].price
prices.push(priceVari)
prices10.push(priceVari*10)
}
*/



if (debugOutput) console.log("*********variEnergy prices10 getVaripricesToday: " + JSON.stringify(prices10));
currentPriceRaw = JsonObject.Prices[0].price
currentPrice = currentPriceRaw
currentPrice = currentPrice.replace(".",",")
Expand Down
2 changes: 1 addition & 1 deletion VariTile1.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Tile {
}
color: !dimState? "black" : "white"
text: "(" + app.lastUpdate + ")"
visible: app.currentPrice.length>1
visible: debugOutput
}


Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
1.0.2

0 comments on commit e6363cc

Please sign in to comment.