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 0870596 commit 0097643
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.8
* Changed: Fixed problems when timeout was set to `0`.

## v1.0.7
* 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-battery/dbus-mqtt-battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def __init__(
self._dbusservice.add_path('/ProductId', 0xFFFF)
self._dbusservice.add_path('/ProductName', productname)
self._dbusservice.add_path('/CustomName', customname)
self._dbusservice.add_path('/FirmwareVersion', '1.0.7 (20231218)')
self._dbusservice.add_path('/FirmwareVersion', '1.0.8 (20240702)')
# self._dbusservice.add_path('/HardwareVersion', '')
self._dbusservice.add_path('/Connected', 1)

Expand Down Expand Up @@ -597,7 +597,7 @@ def main():
logging.warning("Waiting since %s seconds for receiving first data..." % str(i * 5))

# 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 0097643

Please sign in to comment.