Skip to content

Commit

Permalink
fix energy cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Nov 21, 2024
1 parent 48acdab commit 3ca46c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,8 @@ class Bmw extends utils.Adapter {
session.id = session.id.split('_')[1] ? session.id.split('_')[1] : session.id;
session.timestamp = new Date(session.date).valueOf();
if (session.energyCharged.replace) {
session.energy = session.energyCharged.replace('~', '').trim().split(' ')[0];
session.unit = session.energyCharged.replace('~', '').trim().split(' ')[1];
session.energy = session.energyCharged.replace('~', '').replace('<', '').trim().split(' ')[0];
session.unit = session.energyCharged.replace('~', '').replace('<', '').trim().split(' ')[1];
}
if (session.subtitle.replace) {
//subtitle = Zuhause • 2h 16min • ~ 5,97 EUR
Expand Down

0 comments on commit 3ca46c2

Please sign in to comment.