Add input_boolean reporting to Prometheus (#17966)

This commit is contained in:
Tyler 2018-11-06 07:19:36 -05:00 committed by Paulus Schoutsen
parent 1aba4699b9
commit e3a8f3a106

View file

@ -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',