Skip to content

Commit

Permalink
## [2.13.0] - 14.07.2024
Browse files Browse the repository at this point in the history
- Muutos: Kun vuorokausi vaihtuu, hinnat haetaan aina varalta uudelleen ([Katso issue #26](#26))
  - Aiemmin käytettiin jo tiedossa olevia hintoja datan säästämiseksi ja optimoimiseksi
  - Aiemmin jos Nordpoolin hinnoissa oli klo 15:00 virheitä, virheelliset hinnat jäivät voimaan, vaikka korjattu data oli ollut saatavilla
  • Loading branch information
jisotalo committed Jul 14, 2024
1 parent 69fff64 commit 4566fc4
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 9 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# Suomeksi
## [2.13.0] - 14.07.2024
- Muutos: Kun vuorokausi vaihtuu, hinnat haetaan aina varalta uudelleen ([Katso issue #26](https://github.com/jisotalo/shelly-porssisahko/issues/26))
- Aiemmin käytettiin jo tiedossa olevia hintoja datan säästämiseksi ja optimoimiseksi
- Aiemmin jos Nordpoolin hinnoissa oli klo 15:00 virheitä, virheelliset hinnat jäivät voimaan, vaikka korjattu data oli ollut saatavilla

## [2.12.5] - 02.04.2024
- Bugikorjaus: Seuraavan päivän hinnat haettiin kesäaikaan siirtymisen takia vasta 16:00 (15:00 sijaan)

Expand Down Expand Up @@ -163,6 +168,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Versio 2 julkaistu (tehty täysin uusiksi)

# In English
## [2.13.0] - 14.07.2024
- When day changes, the price data is always updated ([See issue #26](https://github.com/jisotalo/shelly-porssisahko/issues/26))
- Before the already known prices were used
- Before, if Nordpool had faulty price data at 15:00, the corrected data was never updated. Now it will always be up-to-date.

## [2.12.5] - 02.04.2024
- Bugfix: Next day prices were read after 16:00 after DST change (instead of 15:00)

Expand Down
2 changes: 1 addition & 1 deletion dist/shelly-porssisahko-addon-temp-hours.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/shelly-porssisahko-addon-temp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/shelly-porssisahko-ht-sensor-temp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/shelly-porssisahko-open-meteo-api.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/shelly-porssisahko-override-avg-price.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/shelly-porssisahko-user-config.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/shelly-porssisahko.js

Large diffs are not rendered by default.

18 changes: 16 additions & 2 deletions src/shelly-porssisahko.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ let C_DEF = {
let _ = {
s: {
/** version number */
v: "2.12.5",
v: "2.13.0",
/** Device name */
dn: '',
/** status as number */
Expand Down Expand Up @@ -449,7 +449,20 @@ function pricesNeeded(dayIndex) {
*/
let dateChanged = getDate(new Date(_.s.p[0].ts * 1000)) !== getDate(now);

//If day changes - do we already have prices in tomorrow data?
//Clear tomorrow data
if (dateChanged) {
_.s.p[1].ts = 0;
_.p[1] = [];
}

/*
-----------------
The following commented code moves tomorrow prices to today
This way we don't need to get prices from Elering again
If using this, comment out the if (dateChanged) { ... } above
-----------------
if (dateChanged && _.s.p[1].ts > 0 && getDate(new Date(_.s.p[1].ts * 1000)) !== getDate(now)) {
//Copy tomorrow data
_.p[0] = _.p[1];
Expand All @@ -464,6 +477,7 @@ function pricesNeeded(dayIndex) {
//No need to fetch from server
dateChanged = false;
}
*/

res = _.s.timeOK && (_.s.p[0].ts == 0 || dateChanged);
}
Expand Down

0 comments on commit 4566fc4

Please sign in to comment.