PySaxPower 1.0.0__tar.gz → 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySaxPower
3
- Version: 1.0.0
4
- Summary: Package for reading Sax devices
3
+ Version: 1.0.1
4
+ Summary: Package for reading Sax devices via modbus
5
5
  Author-email: Hannes <hannes.210@gmx.de>
6
6
  License-Expression: MIT
7
7
  Project-URL: Homepage, https://github.com/Hans-4/pysaxpower
8
8
  Requires-Python: >=3.7
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
- Requires-Dist: pymodbus==2.5
11
+ Requires-Dist: pymodbus==3.15.0
12
12
  Dynamic: license-file
13
13
 
14
14
  # PySaxPower
@@ -46,7 +46,7 @@ pip install PySaxPower
46
46
  ## Usage
47
47
 
48
48
  ```python
49
- from sax_power.power_home_plus import PowerHomePlus
49
+ from pysaxpower import PowerHomePlus
50
50
 
51
51
  device = PowerHomePlus("192.168.178.60")
52
52
 
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySaxPower
3
- Version: 1.0.0
4
- Summary: Package for reading Sax devices
3
+ Version: 1.0.1
4
+ Summary: Package for reading Sax devices via modbus
5
5
  Author-email: Hannes <hannes.210@gmx.de>
6
6
  License-Expression: MIT
7
7
  Project-URL: Homepage, https://github.com/Hans-4/pysaxpower
8
8
  Requires-Python: >=3.7
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
- Requires-Dist: pymodbus==2.5
11
+ Requires-Dist: pymodbus==3.15.0
12
12
  Dynamic: license-file
13
13
 
14
14
  # PySaxPower
@@ -46,7 +46,7 @@ pip install PySaxPower
46
46
  ## Usage
47
47
 
48
48
  ```python
49
- from sax_power.power_home_plus import PowerHomePlus
49
+ from pysaxpower import PowerHomePlus
50
50
 
51
51
  device = PowerHomePlus("192.168.178.60")
52
52
 
@@ -6,5 +6,5 @@ PySaxPower.egg-info/SOURCES.txt
6
6
  PySaxPower.egg-info/dependency_links.txt
7
7
  PySaxPower.egg-info/requires.txt
8
8
  PySaxPower.egg-info/top_level.txt
9
- sax_power/__init_.py
10
- sax_power/power_home_plus.py
9
+ pysaxpower/__init__.py
10
+ pysaxpower/power_home_plus.py
@@ -0,0 +1 @@
1
+ pymodbus==3.15.0
@@ -0,0 +1 @@
1
+ pysaxpower
@@ -33,7 +33,7 @@ pip install PySaxPower
33
33
  ## Usage
34
34
 
35
35
  ```python
36
- from sax_power.power_home_plus import PowerHomePlus
36
+ from pysaxpower import PowerHomePlus
37
37
 
38
38
  device = PowerHomePlus("192.168.178.60")
39
39
 
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "PySaxPower"
7
- version = "1.0.0"
8
- description = "Package for reading Sax devices"
7
+ version = "1.0.1"
8
+ description = "Package for reading Sax devices via modbus"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.7"
11
11
  license = "MIT"
@@ -13,7 +13,7 @@ authors = [
13
13
  {name = "Hannes", email = "hannes.210@gmx.de"}
14
14
  ]
15
15
  dependencies = [
16
- "pymodbus==2.5"
16
+ "pymodbus==3.15.0"
17
17
  ]
18
18
 
19
19
  [project.urls]
@@ -0,0 +1 @@
1
+ from pysaxpower.power_home_plus import PowerHomePlus
@@ -1,4 +1,4 @@
1
- from pymodbus.client.sync import ModbusTcpClient
1
+ from pymodbus.client import ModbusTcpClient
2
2
 
3
3
  class PowerHomePlus:
4
4
  def __init__(
@@ -13,6 +13,8 @@ class PowerHomePlus:
13
13
  timeout=timeout
14
14
  )
15
15
 
16
+ self.connect()
17
+
16
18
  @staticmethod
17
19
  def apply_offset(value: int):
18
20
  offset = 16384
@@ -29,7 +31,7 @@ class PowerHomePlus:
29
31
  results = []
30
32
 
31
33
  for i in range(len(addresses)):
32
- value = self.client.read_holding_registers(address=addresses[i], count=1, unit=64)
34
+ value = self.client.read_holding_registers(address=addresses[i], count=1, device_id=64)
33
35
 
34
36
  if not value.isError():
35
37
  if i > 0:
@@ -43,5 +45,8 @@ class PowerHomePlus:
43
45
 
44
46
  return results
45
47
 
48
+ def connect(self):
49
+ self.client.connect()
50
+
46
51
  def close(self):
47
52
  self.client.close()
@@ -1 +0,0 @@
1
- pymodbus==2.5
@@ -1 +0,0 @@
1
- sax_power
File without changes
File without changes
File without changes