Skip to content

Commit

Permalink
value rounding is now optional. Wh -> kWh
Browse files Browse the repository at this point in the history
  • Loading branch information
unltdnetworx committed Dec 21, 2018
1 parent ed0c63e commit 2d1748c
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 8 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Help or hints are welcome.

## Changelog

### 1.1.4
* value rounding is now optional. Wh -> kWh

### 1.1.3
* code cleanup

Expand Down
5 changes: 4 additions & 1 deletion admin/i18n/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,8 @@
"MyReservePowermeter": "MyReserve-Leistungsmesser",
"WeatherForecast": "Wettervorhersage",
"cloudCover": "Bewölkung",
"temperature": "Temperature"
"temperature": "Temperature",
"yes": ["ja"],
"no": ["nein"],
"round values": ["Werte runden (Wh -> kWh)"]
}
5 changes: 4 additions & 1 deletion admin/i18n/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,8 @@
"MyReservePowermeter": "MyReserve-powermeter",
"WeatherForecast": "WeatherForecast",
"cloudCover": "cloudCover",
"temperature": "temperature"
"temperature": "temperature",
"yes": ["ja"],
"no": ["nein"],
"round values": ["round values (Wh -> kWh)"]
}
7 changes: 7 additions & 0 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@
<label for="managerPassword">manager password</label>
<span class="translate">password for the energymanager</span>
</div>
<div class="input-field col s12 m4">
<select class="value" id="managerRounding">
<option value="no" class="translate" selected>no</option>
<option value="yes" class="translate">yes</option>
</select>
<label for="managerRounding" class="translate">round values</label>
</div>
</div>
<div class="row">
<div class="col s12">
Expand Down
6 changes: 5 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"common": {
"name": "energymanager",
"version": "1.1.3",
"version": "1.1.4",
"news": {
"1.1.4": {
"en": "value rounding is now optional. Wh -> kWh",
"de": "Rundung von Werten ist nun optional. Wh -> kWh"
},
"1.1.3": {
"en": "code cleanup",
"de": "Code aufgeräumt"
Expand Down
16 changes: 12 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,12 @@ function getManagerValues() {
}

if (valTag.search('Work') == 0){
valValue = valValue/1000;
valUnit = 'kWh';
if (adapter.config.managerRounding == "no") {
valUnit = 'Wh';
} else {
valValue = valValue/1000;
valUnit = 'kWh';
}
} else if (valTag.search('Temperature') == 0) {
valUnit = '°C';
} else if (valTag.search('Price') == 0) {
Expand All @@ -183,8 +187,12 @@ function getManagerValues() {
} else if (valTag.search('Resistance') == 0) {
valUnit = 'Ohm';
} else if (valTag.search('Power') == 0) {
valValue = valValue/1000;
valUnit = 'kW';
if (adapter.config.managerRounding == "no") {
valUnit = 'W';
} else {
valValue = valValue/1000;
valUnit = 'kW';
}
} else {
valUnit = '';
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.energymanager",
"version": "1.1.3",
"version": "1.1.4",
"description": "energymanager for kiwigrid powered devices",
"author": {
"name": "Michael Schuster",
Expand Down

0 comments on commit 2d1748c

Please sign in to comment.