From 41af05ea534ec0953d392e599e39d12818c286ff Mon Sep 17 00:00:00 2001 From: Torben Nehmer Date: Sat, 17 Feb 2024 10:08:43 +0000 Subject: [PATCH] Fix Powermeter-autodetection #31 --- custom_components/e3dc_rscp/coordinator.py | 5 ++--- custom_components/e3dc_rscp/diagnostics.py | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/e3dc_rscp/coordinator.py b/custom_components/e3dc_rscp/coordinator.py index b7776ab..423f0f9 100644 --- a/custom_components/e3dc_rscp/coordinator.py +++ b/custom_components/e3dc_rscp/coordinator.py @@ -111,9 +111,8 @@ async def _async_connect_additional_powermeters(self): ) match powermeter["type"]: - case ( - PowermeterType.PM_TYPE_ADDITIONAL_PRODUCTION.value, - PowermeterType.PM_TYPE_ADDITIONAL.value + case ( PowermeterType.PM_TYPE_ADDITIONAL_PRODUCTION.value + | PowermeterType.PM_TYPE_ADDITIONAL.value ): powermeter[ "total-state-class" diff --git a/custom_components/e3dc_rscp/diagnostics.py b/custom_components/e3dc_rscp/diagnostics.py index b9b103b..309ad51 100644 --- a/custom_components/e3dc_rscp/diagnostics.py +++ b/custom_components/e3dc_rscp/diagnostics.py @@ -65,6 +65,7 @@ def _collect_data(self): "current_data": self.coordinator.data, "get_system_info": self._query_data_for_dump(self.e3dc.get_system_info), "get_system_status": self._query_data_for_dump(self.e3dc.get_system_status), + "get_powermeters": self._query_data_for_dump(self.e3dc.get_powermeters), "e3dc_config": self.proxy.e3dc_config, "poll": self._query_data_for_dump(self.e3dc.poll), "switches": self._query_data_for_dump(self.e3dc.poll_switches),