Skip to content

Commit

Permalink
check for nonzero fuels on drones
Browse files Browse the repository at this point in the history
  • Loading branch information
featheredtoast committed Oct 27, 2024
1 parent bb15740 commit 75b6250
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Companion/exporter/drone_station_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ func (c *DroneStationCollector) Collect(frmAddress string, sessionName string) {
home := d.HomeStation
paired := d.PairedStation

DronePortFuelAmount.WithLabelValues(id, home, d.Fuel[0].Name, frmAddress, sessionName).Set(d.Fuel[0].Amount)
if d.ActiveFuel.Name != "N/A" {
if len(d.Fuel) > 0 {
DronePortFuelAmount.WithLabelValues(id, home, d.Fuel[0].Name, frmAddress, sessionName).Set(d.Fuel[0].Amount)
DronePortFuelRate.WithLabelValues(id, home, d.Fuel[0].Name, frmAddress, sessionName).Set(d.ActiveFuel.Rate)
DronePortRndTrip.WithLabelValues(id, home, paired, frmAddress, sessionName).Set(d.LatestRndTrip)
}
DronePortRndTrip.WithLabelValues(id, home, paired, frmAddress, sessionName).Set(d.LatestRndTrip)

val, ok := powerInfo[d.PowerInfo.CircuitGroupId]
if ok {
Expand Down

0 comments on commit 75b6250

Please sign in to comment.