From bdba3e193edf0a404dc18d4f06a658ae7e492d74 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 26 Apr 2022 11:43:45 +0200 Subject: [PATCH] Use climate enums in prometheus (#70772) --- homeassistant/components/prometheus/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/prometheus/__init__.py b/homeassistant/components/prometheus/__init__.py index 7690ee5d1fc..949895cb76a 100644 --- a/homeassistant/components/prometheus/__init__.py +++ b/homeassistant/components/prometheus/__init__.py @@ -14,7 +14,7 @@ from homeassistant.components.climate.const import ( ATTR_HVAC_MODES, ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW, - CURRENT_HVAC_ACTIONS, + HVACAction, ) from homeassistant.components.http import HomeAssistantView from homeassistant.components.humidifier.const import ( @@ -438,8 +438,8 @@ class PrometheusMetrics: "HVAC action", ["action"], ) - for action in CURRENT_HVAC_ACTIONS: - metric.labels(**dict(self._labels(state), action=action)).set( + for action in HVACAction: + metric.labels(**dict(self._labels(state), action=action.value)).set( float(action == current_action) )