mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Use climate enums in prometheus (#70772)
This commit is contained in:
parent
f7d9797c62
commit
bdba3e193e
@ -14,7 +14,7 @@ from homeassistant.components.climate.const import (
|
|||||||
ATTR_HVAC_MODES,
|
ATTR_HVAC_MODES,
|
||||||
ATTR_TARGET_TEMP_HIGH,
|
ATTR_TARGET_TEMP_HIGH,
|
||||||
ATTR_TARGET_TEMP_LOW,
|
ATTR_TARGET_TEMP_LOW,
|
||||||
CURRENT_HVAC_ACTIONS,
|
HVACAction,
|
||||||
)
|
)
|
||||||
from homeassistant.components.http import HomeAssistantView
|
from homeassistant.components.http import HomeAssistantView
|
||||||
from homeassistant.components.humidifier.const import (
|
from homeassistant.components.humidifier.const import (
|
||||||
@ -438,8 +438,8 @@ class PrometheusMetrics:
|
|||||||
"HVAC action",
|
"HVAC action",
|
||||||
["action"],
|
["action"],
|
||||||
)
|
)
|
||||||
for action in CURRENT_HVAC_ACTIONS:
|
for action in HVACAction:
|
||||||
metric.labels(**dict(self._labels(state), action=action)).set(
|
metric.labels(**dict(self._labels(state), action=action.value)).set(
|
||||||
float(action == current_action)
|
float(action == current_action)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user