More packaging structure

This commit is contained in:
Paul Warren 2024-10-08 17:01:54 +11:00
parent cfc53a3267
commit 86b3862bc2
2 changed files with 18 additions and 37 deletions

View file

@ -1,37 +0,0 @@
#!/usr/bin/env python3
import FroniusReg
from pymodbus.client.tcp import ModbusTcpClient
fronius1 = ModbusTcpClient("172.19.107.211", port=502, timeout=10)
fronius1.connect()
soc = FroniusReg.scaledStateOfCharge.getValue(fronius1)
print(" SOC: %s%%" % soc)
discharge = FroniusReg.scaledOutWRte.getValue(fronius1)
print("Pre DRate: %d%%" % discharge)
charge = FroniusReg.scaledInWRte.getValue(fronius1)
print("Pre CRate: %d%%" % charge)
mode = FroniusReg.StorCtl_Mode.getValue(fronius1)
print("Pre Mode: %d" % mode)
# This should be 'limit discharge' mode
err = FroniusReg.StorCtl_Mode.setValue(fronius1, 2)
# Charge battery at a rate from -2% discharge to 100% charge
# as a percentage of the MaxChaRte, which in our case is 25600W
err = FroniusReg.scaledOutWRte.setValue(fronius1, -10)
err = FroniusReg.scaledInWRte.setValue(fronius1, 100)
discharge = FroniusReg.scaledOutWRte.getValue(fronius1)
print("Post DRate: %d%%" % discharge)
charge = FroniusReg.scaledInWRte.getValue(fronius1)
print("Post CRate: %d%%" % charge)
mode = FroniusReg.StorCtl_Mode.getValue(fronius1)
print("Post Mode: %d" % mode)

18
pyproject.toml Normal file
View file

@ -0,0 +1,18 @@
[project]
name = "Python Fronius Registers"
version = "0.0.1"
authors = [
{ name = "Paul Warren", email="pwarren@pwarren.id.au" }
]
description = "A library to make interacting with Fronius Inverters and Charging systems simpler"
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: AGPL License",
"Operating System :: OS Independent",
]
[project.urls]
Homepage = "https://git.pwarren.id.au/pwarren/PyFroniusReg/"
Issues = "https://git.pwarren.id.au/pwarren/PyFroniusReg/issues"