Add input_boolean reporting to Prometheus (#17966)
This commit is contained in:
1 parent
1aba4699b9
commit
e3a8f3a106
1 file changed
+9
@@ -138,6 +138,15 @@ class PrometheusMetrics:
|
||||
value = state_helper.state_as_number(state)
|
||||
metric.labels(**self._labels(state)).set(value)
|
||||
|
||||
def _handle_input_boolean(self, state):
|
||||
metric = self._metric(
|
||||
'input_boolean_state',
|
||||
self.prometheus_client.Gauge,
|
||||
'State of the input boolean (0/1)',
|
||||
)
|
||||
value = state_helper.state_as_number(state)
|
||||
metric.labels(**self._labels(state)).set(value)
|
||||
|
||||
def _handle_device_tracker(self, state):
|
||||
metric = self._metric(
|
||||
'device_tracker_state',
|
||||
|
||||
Reference in new issue
Block a user