Skip to content

Commit

Permalink
Fixed timeout = 0 problems
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Jul 2, 2024
1 parent 58b31e5 commit f67416b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v1.0.2
* Changed: Fixed problems when timeout was set to `0`.

## v1.0.1
* Added: Timeout on driver startup. Prevents problems, if the MQTT broker is not reachable on driver startup

Expand Down
4 changes: 2 additions & 2 deletions dbus-mqtt-solar-charger/dbus-mqtt-solar-charger.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def __init__(
self._dbusservice.add_path("/ProductName", productname)
self._dbusservice.add_path("/CustomName", customname)
self._dbusservice.add_path("/FirmwareVersion", 399)
self._dbusservice.add_path("/HardwareVersion", "1.0.1 (20231218)")
self._dbusservice.add_path("/HardwareVersion", "1.0.2 (20240702)")
self._dbusservice.add_path("/Connected", 1)

self._dbusservice.add_path("/Latency", None)
Expand Down Expand Up @@ -612,7 +612,7 @@ def main():
)

# check if timeout was exceeded
if timeout <= (i * 5):
if timeout != 0 and timeout <= (i * 5):
logging.error(
"Driver stopped. Timeout of %i seconds exceeded, since no new MQTT message was received in this time."
% timeout
Expand Down

0 comments on commit f67416b

Please sign in to comment.