From e3a8f3a106303cf313cf4782380a72e51e31a60d Mon Sep 17 00:00:00 2001 From: Tyler Date: Tue, 6 Nov 2018 07:19:36 -0500 Subject: [PATCH] Add input_boolean reporting to Prometheus (#17966) --- homeassistant/components/prometheus.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/homeassistant/components/prometheus.py b/homeassistant/components/prometheus.py index ee4b88d4d9b..dc868530f88 100644 --- a/homeassistant/components/prometheus.py +++ b/homeassistant/components/prometheus.py @@ -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',