From 98d7702b27b4c61e51697c5a4901560b7b7c716f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Seux?= Date: Fri, 17 May 2024 13:53:24 +0200 Subject: [PATCH] Add active rules sensor Fix #203 --- custom_components/aquarea/definitions.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/custom_components/aquarea/definitions.py b/custom_components/aquarea/definitions.py index a0f134b..3c77067 100644 --- a/custom_components/aquarea/definitions.py +++ b/custom_components/aquarea/definitions.py @@ -1706,6 +1706,15 @@ def build_sensors(mqtt_prefix: str) -> list[HeishaMonSensorEntityDescription]: entity_category=EntityCategory.DIAGNOSTIC, state_class=SensorStateClass.TOTAL_INCREASING, ), + HeishaMonSensorEntityDescription( + heishamon_topic_id="STAT1-active-rules", + key=f"{mqtt_prefix}stats", + name="HeishaMon Active rules", + state=partial(read_stats_json, "rules active"), + device=DeviceType.HEISHAMON, + entity_category=EntityCategory.DIAGNOSTIC, + state_class=SensorStateClass.MEASUREMENT, + ), HeishaMonSensorEntityDescription( heishamon_topic_id="INFO_ip", key=f"{mqtt_prefix}ip",