Skip to content

docs(README): Add usage_example in README - #46

Merged
mirzak merged 1 commit into
mainfrom
usage_example
Nov 5, 2025
Merged

docs(README): Add usage_example in README#46
mirzak merged 1 commit into
mainfrom
usage_example

Conversation

@Dexter9532

@Dexter9532 Dexter9532 commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

closes #40

@mirzak mirzak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we intend to publish to PyPi, we need to keep in mind that the README.md will be displayed on the front page. This means that it should be user facing.

See https://pypi.org/project/python-can/ for reference.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
@Dexter9532
Dexter9532 force-pushed the usage_example branch 3 times, most recently from 1ef5480 to 83daabc Compare November 4, 2025 08:53
@Dexter9532
Dexter9532 requested a review from mirzak November 4, 2025 08:53

@mirzak mirzak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has a "generated by AI" smell to it (with all the icons and the superfluous text).

Lets keep it simple, and do the following:

in DEVELOPMENT.MD put the existing README (as-is).

In README.md write,

## python-em511

python-em511 provides a simple, Pythonic interface for reading and writing data 
from Carlo Gavazzi EM511 series energy meters over Modbus RTU. It builds on top 
of [pymodbus](https://pypi.org/project/pymodbus/).

## Example usage:

```python
from em511 import Em511
from pymodbus.client import ModbusSerialClient

# Configure the Modbus client
client = ModbusSerialClient(
   port="COM3",  # or "/dev/ttyUSB0" on Linux
   baudrate=9600,
   parity="E",
   stopbits=1,
   bytesize=8,
   # datasheet specifies maximum response timeout of 500ms (typical 40ms)
   timeout=0.5,
)

# Device Modbus address
device_address = 1

# Initialize the EM511 driver
meter = Em511(device_address=device_address, client=client)

# Read voltage
voltage = meter.V
print(f"Voltage: {voltage} V")

# Example of writing a password-protected parameter
meter.password = 1234
```

## Report issues

If you run into problems, you can ask for help in our [issue tracker](https://github.com/id8-engineering/python-em511/issues) on GitHub.

## Contributing

See [CONTRIBUTING.MD](https://github.com/id8-engineering/python-em511/blob/main/CONTRIBUTING.MD) and >[DEVELOPMENT.MD](https://github.com/id8-engineering/python-em511/blob/main/DEVELOPMENT.MD).

@Dexter9532

Copy link
Copy Markdown
Contributor Author

this is AI who helped us, when i watch other READMEs this is how they do it
https://www.lazyvim.org/
this is and example

@Dexter9532
Dexter9532 requested a review from mirzak November 4, 2025 10:31

@mirzak mirzak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And squash commits.

Comment thread DEVELOPMENT.MD Outdated
Comment thread README.md Outdated
Signed-off-by: Bobo Bäck Engström <bobo@id8-engineering.io>

docs(DEVELOPMENT): add DEVELOPMENT

Signed-off-by: Bobo Bäck Engström <bobo@id8-engineering.io>
@mirzak
mirzak merged commit a6320d2 into main Nov 5, 2025
20 checks passed
@mirzak
mirzak deleted the usage_example branch November 5, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update README to include usage example

2 participants