mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Add input_boolean reporting to Prometheus (#17966)
This commit is contained in:
parent
1aba4699b9
commit
e3a8f3a106
@ -138,6 +138,15 @@ class PrometheusMetrics:
|
|||||||
value = state_helper.state_as_number(state)
|
value = state_helper.state_as_number(state)
|
||||||
metric.labels(**self._labels(state)).set(value)
|
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):
|
def _handle_device_tracker(self, state):
|
||||||
metric = self._metric(
|
metric = self._metric(
|
||||||
'device_tracker_state',
|
'device_tracker_state',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user