Skip to content

Commit

Permalink
v1.0.16: order registers in init
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseklm committed Aug 7, 2024
1 parent 30e2b3f commit 6593b77
Show file tree
Hide file tree
Showing 2 changed files with 5 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.15
image: ghcr.io/jesseklm/sungrowmodbus2mqtt:v1.0.16
restart: unless-stopped
volumes:
- ./config.sh10rt.yaml:/config/config.yaml:ro
```
- `wget -O config.sh10rt.yaml https://raw.githubusercontent.com/jesseklm/sungrowmodbus2mqtt/v1.0.15/config.sh10rt.example.yaml`
- `wget -O config.sh10rt.yaml https://raw.githubusercontent.com/jesseklm/sungrowmodbus2mqtt/v1.0.16/config.sh10rt.example.yaml`
- adjust your config yaml
- `docker compose up -d`
4 changes: 3 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.15'
__version__ = '1.0.16'


class SungrowModbus2Mqtt:
Expand Down Expand Up @@ -90,6 +90,8 @@ def init_registers(self, config: dict):
self.init_register('input', register)
for register in config.get('holding', []):
self.init_register('holding', register)
for table in self.registers:
self.registers[table] = dict(sorted(self.registers[table].items()))

def read(self):
for table in self.registers:
Expand Down

0 comments on commit 6593b77

Please sign in to comment.