Skip to content

Commit

Permalink
Support the person component in Prometheus (#21363)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellrj authored and Danielhiversen committed Feb 23, 2019
1 parent d027965 commit c595cf0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions homeassistant/components/prometheus/__init__.py
Expand Up @@ -151,6 +151,15 @@ def _handle_device_tracker(self, state):
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',
Expand Down

0 comments on commit c595cf0

Please sign in to comment.