flod-1 / LoxBerry-Plugin-Tibber2MQTT

LoxBerry Plugin Tibber2MQTT
3 stars 1 forks source link

Level indication "0" when "use cents instead of Euro" is active #1

Closed TheBruny closed 1 year ago

TheBruny commented 1 year ago

Dear flod-1,

I have found out a problem when selecting the option "use send instead of Euro" / "Verwende Cent statt Euro". In this case the level will be read out as "0", because process.php does multiply the value with 100, but the value is a string.

Code:

if($tb_config->SendasCents == true){
    $priceRecord[$requestedValueKey] = $priceRecord[$requestedValueKey]*100;
}

Line 209 ff.

Fixed issue:

 if(($tb_config->SendasCents == true) && ($requestedValueKey != "level")){
          $priceRecord[$requestedValueKey] = $priceRecord[$requestedValueKey]*100;
  }

With best regards TheBruny

flod-1 commented 1 year ago

Thanks for your report, @TheBruny! Problem is fixed in new version. :)