From 19c3d9058ad2a5e9075677bc1ae97045e0c1a9ee Mon Sep 17 00:00:00 2001 From: nao-pon Date: Mon, 22 Apr 2024 20:31:56 +0900 Subject: [PATCH] Fix #179 Energy-related sensors are not enabled by default --- custom_components/echonetlite/__init__.py | 2 +- custom_components/echonetlite/const.py | 2 -- custom_components/echonetlite/sensor.py | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/custom_components/echonetlite/__init__.py b/custom_components/echonetlite/__init__.py index 0d6e104..d0ccc2f 100644 --- a/custom_components/echonetlite/__init__.py +++ b/custom_components/echonetlite/__init__.py @@ -555,7 +555,7 @@ def _make_update_flags_full_list(self): # Is enabled CONF_ENABLE_SUPER_ENERGY _enabled_super_energy = self._user_options.get( CONF_ENABLE_SUPER_ENERGY, - ENABLE_SUPER_ENERGY_DEFAULT.get(self._eojgc, {}).get(self._eojcc, False), + ENABLE_SUPER_ENERGY_DEFAULT.get(self._eojgc, {}).get(self._eojcc, True), ) # Some classes use predefined data (Narrowed down items) flags = EPC_CODES_FOR_UPDATE.get(self._eojgc, {}).get(self._eojcc, None) diff --git a/custom_components/echonetlite/const.py b/custom_components/echonetlite/const.py index 4b8f5b9..20e957b 100644 --- a/custom_components/echonetlite/const.py +++ b/custom_components/echonetlite/const.py @@ -1048,8 +1048,6 @@ ENL_HVAC_ROOM_TEMP, ENL_HVAC_OUT_TEMP, ENL_HVAC_SILENT_MODE, - ENL_INSTANTANEOUS_POWER, - ENL_CUMULATIVE_POWER, ], }, 0x02: { diff --git a/custom_components/echonetlite/sensor.py b/custom_components/echonetlite/sensor.py index 8addea5..705e5ca 100644 --- a/custom_components/echonetlite/sensor.py +++ b/custom_components/echonetlite/sensor.py @@ -74,7 +74,7 @@ async def async_setup_entry(hass, config, async_add_entities, discovery_info=Non if entity["echonetlite"]._user_options.get( CONF_ENABLE_SUPER_ENERGY, - ENABLE_SUPER_ENERGY_DEFAULT.get(eojgc, {}).get(eojcc, False), + ENABLE_SUPER_ENERGY_DEFAULT.get(eojgc, {}).get(eojcc, True), ): _enl_super_codes = ENL_SUPER_CODES else: