Skip to content

Commit d1dcd3f

Browse files
committed
docs(README): Add usage_example in README
Signed-off-by: Bobo Bäck Engström <bobo@id8-engineering.io>
1 parent 0af06c0 commit d1dcd3f

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,31 @@ Build package:
3737
```sh
3838
uv build
3939
```
40+
41+
### Usage
42+
43+
Below is minimal example of how to use the Em511 driver
44+
45+
```py
46+
from em511 import Em511
47+
from pymodbus.client import ModbusSerialClient
48+
49+
client = ModbusSerialClient(
50+
port="COM3",
51+
baudrate=9600,
52+
parity="E",
53+
stopbits=1,
54+
bytesize=8,
55+
timeout=1,
56+
)
57+
58+
device_address = 1
59+
60+
meter = Em511(device_address=device_address, client=client)
61+
62+
Voltage = meter.V
63+
meter.password = 1234
64+
```
65+
```
66+
67+

0 commit comments

Comments
 (0)