diff --git a/force_charge.py b/force_charge.py deleted file mode 100755 index cf840b1..0000000 --- a/force_charge.py +++ /dev/null @@ -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) - diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..98bfe92 --- /dev/null +++ b/pyproject.toml @@ -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" \ No newline at end of file