Support the person component in Prometheus (#21363)

This commit is contained in:
Richard Mitchell 2019-02-23 17:13:27 +00:00 committed by Daniel Høyer Iversen
parent d027965304
commit c595cf016f

View File

@ -151,6 +151,15 @@ class PrometheusMetrics:
value = state_helper.state_as_number(state)
metric.labels(**self._labels(state)).set(value)
def _handle_person(self, state):
metric = self._metric(
'person_state',
self.prometheus_client.Gauge,
'State of the person (0/1)',
)
value = state_helper.state_as_number(state)
metric.labels(**self._labels(state)).set(value)
def _handle_light(self, state):
metric = self._metric(
'light_state',