fix exporter name

This commit is contained in:
shoopea 2023-12-16 16:07:38 +01:00
parent 6efd4fbbca
commit edd8b778f3

View File

@ -176,7 +176,7 @@ shellyplug_temperature %.2f
# HELP shellyplug_uptime Plug uptime in seconds
# TYPE shellyplug_uptime gauge
shellyplug_uptime %d
`, exporterName, ss.Status1.Meters[0].Counters[0], float32(0), 0, ss.Status1.Temperature, ss.Status1.Uptime)
`, *exporterName, ss.Status1.Meters[0].Counters[0], float32(0), 0, ss.Status1.Temperature, ss.Status1.Uptime)
case 2:
c.String(http.StatusOK, `shellyplug_name %s
# HELP shellyplug_power Current power drawn in watts
@ -194,7 +194,7 @@ shellyplug_temperature %.2f
# HELP shellyplug_uptime Plug uptime in seconds
# TYPE shellyplug_uptime gauge
shellyplug_uptime %d
`, exporterName, ss.Status2.Switch.Power, float32(0), 0, ss.Status2.Switch.Temperature.Celsius, ss.Status2.Sys.Uptime)
`, *exporterName, ss.Status2.Switch.Power, float32(0), 0, ss.Status2.Switch.Temperature.Celsius, ss.Status2.Sys.Uptime)
default:
c.String(http.StatusOK, `shellyplug_name %s
# HELP shellyplug_power Current power drawn in watts
@ -212,7 +212,7 @@ shellyplug_temperature %.2f
# HELP shellyplug_uptime Plug uptime in seconds
# TYPE shellyplug_uptime gauge
shellyplug_uptime %d
`, exporterName, float32(0), float32(0), 0, float32(0), 0)
`, *exporterName, float32(0), float32(0), 0, float32(0), 0)
}
}