Skip to content

Commit

Permalink
Ticket #163: Split the price from price points in the interface (not …
Browse files Browse the repository at this point in the history
…functionally split yet)
  • Loading branch information
frodeheg committed Jan 15, 2023
1 parent 3d6cf04 commit 033e4d1
Show file tree
Hide file tree
Showing 5 changed files with 273 additions and 225 deletions.
10 changes: 7 additions & 3 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@
},
"devices": {
"title": "Devices",
"meterReader": "Meter Reader",
"controllable": "Controllable devices",
"modes": "Modes and priority",
"prices": "Price management"
},
"advanced": {
"title": "Advanced",
"basic": "Basic settings",
"cost": "Cost settings",
"settings": "Advanced settings",
"charger": "Car chargers",
"frost": "Frost guard",
Expand Down Expand Up @@ -150,7 +151,6 @@
"VAT": "VAT",
"gridTaxDay": "Grid charge 06-22",
"gridTaxNight": "Grid charge 22-06",
"gridheader": "Grid capacity costs",
"gridLimit": "Capacity step (Wh)",
"gridCost": "Monthly cost",
"gridLimitHint": "If you configure the cost per capacity step according to your grid provider, then your montly savings will be correctly calculated."
Expand All @@ -176,6 +176,7 @@
"unreliableDevice": "The selected device is only ${reliability}% reliable. Can this explain the problems you're having? If not, please include your email in the report so we can solve this together."
},
"meter": {
"title": "Energy readings",
"meterReader": "Meter reader",
"meterReaderNotFound": "No meter reader was found, you must use a flow card to send the power consumption to the app.",
"meterReaderHint": "If the app has support for your meter reader it will show up here, otherwise you have to input the power readings by using a flow",
Expand Down Expand Up @@ -213,6 +214,9 @@
},
"price": {
"header": "Price management",
"usagePart": "Utility cost",
"powerPart": "Grid capacity costs",
"limitPart": "Limiter part",
"priceMode": "Mode",
"mode": {
"flow": "Manually from flows",
Expand Down Expand Up @@ -246,7 +250,7 @@
"--><p>Manual control from flow cards give you greatest flexibility but leave all the responsibility to interpret the electricity price to you.</p><!--",
"--><p>Automatic interprets the prices according to the preferences set in the app.</p>"],
"priceErr1": "Note! You have to install the app 'Norwegian Electricity Bill' and acompanying device for external prices to be fetched. The prices are fetched seamlessly, flow cards are not necessary.",
"priceAdvanced": "Advanced price settings",
"pricePointAdvanced": "Price point magic",
"pricePoint": "Price point",
"pricePointHint": "The behaviour of each price point is defined below. Price points can be changed by using flows.",
"action": "Action",
Expand Down
10 changes: 7 additions & 3 deletions locales/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@
},
"devices": {
"title": "Enheter",
"meterReader": "Måleravleser",
"controllable": "Kontrollerbare enheter",
"modes": "Modus og prioritet",
"prices": "Prisstyring"
},
"advanced": {
"title": "Avansert",
"basic": "Grunnleggende innstillinger",
"cost": "Kostnad",
"settings": "Avanserte innstillinger",
"charger": "Lading av elbil",
"frost": "Frostsikring",
Expand Down Expand Up @@ -150,7 +151,6 @@
"VAT": "Moms",
"gridTaxDay": "Nettleie 06-22",
"gridTaxNight": "Nettleie 22-06",
"gridheader": "Nettleie kapasitetsledd",
"gridLimit": "Kapasitetsledd (Wh)",
"gridCost": "Kostnad per mnd.",
"gridLimitHint": "Dersom du legger inn kostnad per kapasitetsledd fra din nettleverandør vil appen regne ut hvor mye du sparer over tid."
Expand All @@ -176,6 +176,7 @@
"unreliableDevice": "Den valgte enheten er bare ${reliability}% pålitelig. Kan dette forklare problemene du har? Hvis ikke, vennligst inkluder epost-adresse i rapporten så vi kan løse problemet sammen."
},
"meter": {
"title": "Energiavlesning",
"meterReader": "Strømmåler",
"meterReaderNotFound": "Ingen strømmåler ble funnet, du må bruke et flytkort for å sende strømforbruket til appen.",
"meterReaderHint": "Dersom appen har støtte for strømmåleren din kan du velge den her, ellers må du sette opp et flytkort for å sende effekt-avlesningene til appen.",
Expand Down Expand Up @@ -213,6 +214,9 @@
},
"price": {
"header": "Prisstyring",
"usagePart": "Bruksledd",
"powerPart": "Effektledd",
"limitPart": "Begrensninger",
"priceMode": "Modus",
"mode": {
"flow": "Manuelt fra flytkort",
Expand Down Expand Up @@ -246,7 +250,7 @@
"--><p>Manuell styring fra flytkort gir deg størst fleksibilitet men overlater alt ansvaret for å tolke strømprisen til deg.</p><!--",
"--><p>Automatisk tolker strømprisen etter preferansene i appen.</p>"],
"priceErr1": "NB! Du må installere appen 'Strømregning' og tilhørende enhet for å velge eksterne priser. Strømprisen hentes sømløst uten å benytte flytkort.",
"priceAdvanced": "Avansert prisstyring",
"pricePointAdvanced": "Prisstyringsmagi",
"pricePoint": "Prispunkt",
"pricePointHint": "Oppførsel for hvert prispunkt kan endres nedenfor. Man kan bytte mellom ulike prispunkt ved hjelp av flytkort.",
"action": "Handling",
Expand Down
7 changes: 7 additions & 0 deletions settings/gridcost.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ let gridCost = [

function setGridCost(costTable) {
gridCost = costTable;
let table = document.getElementById('gridCostsTable');
for (let i = 0; i < gridCost.length; i++) {
let { limit, price } = gridCost[i];
if (table.rows.length <= (i + 1)) {
addMaxPowerElement();
}
}
}

function getGridAbove(usage) {
Expand Down

0 comments on commit 033e4d1

Please sign in to comment.