Skip to content

Commit

Permalink
Update 2.5.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
NyboTV committed Aug 1, 2022
1 parent 0084dcc commit 1cfdaf7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/bin/config/cfg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.5.5.1",
"version": "2.5.5.2",
"refreshInterval": 100,
"debug": false,
"firstInstall": true
Expand Down
14 changes: 10 additions & 4 deletions src/bin/modules/states/truck.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ const truckStates = async (TPClient, refreshInterval, telemetry_path, logIt, tim

Fuel = Math.round(truck.fuel)
FuelConsumption = truck.fuelAverageConsumption
FuelCapacity = truck.fuelCapacity
FuelCapacity = Math.round(truck.fuelCapacity)
AdBlue = Math.round(truck.adblue)

AirPressure = Math.round(truck.airPressure)
Expand Down Expand Up @@ -647,9 +647,13 @@ const truckStates = async (TPClient, refreshInterval, telemetry_path, logIt, tim
states.push(data)
}

if(FuelConsumption !== FuelConsumptionOld || offline === true) {
if(FuelConsumption !== FuelConsumptionOld || unit !== unitOld || offline === true) {
FuelConsumptionOld = FuelConsumption

if(unit === "miles") {
FuelConsumption = Math.floor(FuelConsumption / 3.785)
}

var data = {
id: "Nybo.ETS2.Dashboard.FuelConsumption",
value: `${FuelConsumption}`
Expand All @@ -658,10 +662,12 @@ const truckStates = async (TPClient, refreshInterval, telemetry_path, logIt, tim
states.push(data)
}

if(FuelCapacity !== FuelCapacityOld || offline === true) {
if(FuelCapacity !== FuelCapacityOld || unit !== unitOld || offline === true) {
FuelCapacityOld = FuelCapacity

FuelCapacity = Math.round(FuelCapacity)
if(unit === "miles") {
FuelCapacity = Math.floor(FuelCapacity / 3.785)
}

var data = {
id: "Nybo.ETS2.Dashboard.FuelCapacity",
Expand Down
2 changes: 1 addition & 1 deletion src/build/bin/config/cfg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.5.5.1",
"version": "2.5.5.2",
"refreshInterval": 200,
"debug": false,
"firstInstall": true
Expand Down

0 comments on commit 1cfdaf7

Please sign in to comment.