Skip to content

Commit

Permalink
v1.0.17: log loop time in debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseklm committed Aug 8, 2024
1 parent 6593b77 commit c51fdfd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ Tested: SH10RT
services:
sungrowmodbus2mqtt:
container_name: sungrowmodbus2mqtt
image: ghcr.io/jesseklm/sungrowmodbus2mqtt:v1.0.16
image: ghcr.io/jesseklm/sungrowmodbus2mqtt:v1.0.17
restart: unless-stopped
volumes:
- ./config.sh10rt.yaml:/config/config.yaml:ro
```
- `wget -O config.sh10rt.yaml https://raw.githubusercontent.com/jesseklm/sungrowmodbus2mqtt/v1.0.16/config.sh10rt.example.yaml`
- `wget -O config.sh10rt.yaml https://raw.githubusercontent.com/jesseklm/sungrowmodbus2mqtt/v1.0.17/config.sh10rt.example.yaml`
- adjust your config yaml
- `docker compose up -d`
3 changes: 2 additions & 1 deletion sungrowmodbus2mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from modbus_handler import ModbusHandler
from mqtt_handler import MqttHandler

__version__ = '1.0.16'
__version__ = '1.0.17'


class SungrowModbus2Mqtt:
Expand Down Expand Up @@ -41,6 +41,7 @@ def loop(self):
self.publish()
time_taken = time() - start_time
time_to_sleep = self.update_rate - time_taken
logging.debug(f'looped in {time_taken}s, sleeping {time_to_sleep}s.')
if time_to_sleep > 0:
sleep(time_to_sleep)

Expand Down

0 comments on commit c51fdfd

Please sign in to comment.