diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c3e1d3..25ad909 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## v0.2.1 +* Changed: Increased timeout for fetch_meter_stream() from 5 seconds to 60 seconds. Output a warning, if it take longer than 5 seconds + ## v0.2.0 * Added: StatusCode: 7 = Running; 8 = Standby (if power below 5 W) diff --git a/dbus-enphase-envoy/dbus-enphase-envoy.py b/dbus-enphase-envoy/dbus-enphase-envoy.py index ab76b3f..dd6f371 100644 --- a/dbus-enphase-envoy/dbus-enphase-envoy.py +++ b/dbus-enphase-envoy/dbus-enphase-envoy.py @@ -363,7 +363,7 @@ def fetch_meter_stream(): response = requests.get( url, stream=True, - timeout=5, + timeout=60, headers=request_headers, verify=False ) @@ -371,7 +371,7 @@ def fetch_meter_stream(): response = requests.get( url, stream=True, - timeout=5, + timeout=60, auth=HTTPDigestAuth('installer', config['ENVOY']['password']) ) @@ -381,6 +381,9 @@ def fetch_meter_stream(): keep_running = False sys.exit() + if response.elapsed.total_seconds() > 5: + logging.warning("--> fetch_meter_stream(): HTTP request took longer than 5 seconds: %s seconds" % response.elapsed.total_seconds()) + for row in response.iter_lines(): if keep_running is False: @@ -1330,7 +1333,7 @@ def __init__( self._dbusservice.add_path('/ProductId', 0xFFFF) self._dbusservice.add_path('/ProductName', productname) self._dbusservice.add_path('/CustomName', productname) - self._dbusservice.add_path('/FirmwareVersion', '0.2.0 (20231107)') + self._dbusservice.add_path('/FirmwareVersion', '0.2.1 (20231204)') self._dbusservice.add_path('/HardwareVersion', hardware) self._dbusservice.add_path('/Connected', 1)