From 980f6663a73e8d2d0aaa0e46f638c53e4868ef4b Mon Sep 17 00:00:00 2001 From: LKuemmel Date: Mon, 12 May 2025 14:52:27 +0200 Subject: [PATCH] fix enphase --- packages/modules/devices/enphase/enphase/device.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/modules/devices/enphase/enphase/device.py b/packages/modules/devices/enphase/enphase/device.py index c5ed9dbcc9..3d821df3c3 100644 --- a/packages/modules/devices/enphase/enphase/device.py +++ b/packages/modules/devices/enphase/enphase/device.py @@ -107,7 +107,7 @@ def receive_token() -> bool: def update_components(components: Iterable[Union[EnphaseBat, EnphaseCounter, EnphaseInverter]]): nonlocal token_fails - if device_config.configuration.version == EnphaseVersion.V2.value: + if device_config.configuration.version == EnphaseVersion.V2: # v2 requires token authentication if check_token() is False: log.error("no valid token to connect to envoy") @@ -115,12 +115,12 @@ def update_components(components: Iterable[Union[EnphaseBat, EnphaseCounter, Enp log.debug("Start device reading " + str(components)) with req.get_http_session() as session: json_live_data = None - if device_config.configuration.version == EnphaseVersion.V1.value: + if device_config.configuration.version == EnphaseVersion.V1: json_response = session.get( 'http://'+device_config.configuration.hostname+'/ivp/meters/readings', timeout=5).json() # json_live_data does not exist on older firmware - elif device_config.configuration.version == EnphaseVersion.V2.value: + elif device_config.configuration.version == EnphaseVersion.V2: response = session.get( 'https://'+device_config.configuration.hostname+'/ivp/meters/readings', timeout=5, verify=False,