pytouchline-extended 0.4__tar.gz → 0.4.2__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,18 +1,17 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytouchline_extended
3
- Version: 0.4
3
+ Version: 0.4.2
4
4
  Summary: A Roth Touchline interface library
5
5
  Home-page: https://github.com/brondum/pytouchline
6
6
  Author: Peter Brondum
7
7
  License: MIT
8
- Download-URL: https://github.com/brondum/pytouchline/archive/0.4.tar.gz
9
8
  Keywords: Roth,Touchline,Home Assistant,hassio,Heat pump
10
- Platform: UNKNOWN
11
9
  Classifier: Development Status :: 3 - Alpha
12
10
  Classifier: Intended Audience :: Developers
13
11
  Classifier: License :: OSI Approved :: MIT License
14
12
  Classifier: Programming Language :: Python :: 3
15
13
  License-File: LICENSE
14
+ Requires-Dist: httplib2
15
+ Requires-Dist: faust-cchardet
16
16
 
17
- UNKNOWN
18
-
17
+ A simple helper library for controlling a Roth Touchline heat pump controller
@@ -0,0 +1,58 @@
1
+ # Python Library for Roth Touchline (Extended)
2
+
3
+ This is an extended version of the original `pytouchline` library, a simple helper library for controlling a Roth Touchline heat pump controller. This fork introduces additional features and improvements over the original version.
4
+
5
+ ## Installation
6
+
7
+ You can install the extended version of `pytouchline` from PyPI:
8
+
9
+ ```bash
10
+ pip install pytouchline_extended
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Here's a basic example of how to use `pytouchline_extended`:
16
+
17
+ ```python
18
+ from pytouchline_extended import PyTouchline
19
+
20
+ py_touchline = PyTouchline(url="http://192.168.1.254")
21
+
22
+ numberOfDevices = py_touchline.get_number_of_devices()
23
+ # for each device, get information
24
+ for x in range(0, numberOfDevices):
25
+ devices.append(PyTouchline(id=x, url="http://192.168.1.254"))
26
+ devices[x].update()
27
+ print(x)
28
+ print(devices[x].get_name())
29
+ print(devices[x].get_current_temperature())
30
+ print(devices[x].get_target_temperature())
31
+ print(devices[x].get_target_temperature_high())
32
+ print(devices[x].get_target_temperature_low())
33
+ print(devices[x].get_week_program())
34
+ print(devices[x].get_operation_mode())
35
+ print(devices[x].get_device_id())
36
+ print(devices[x].get_controller_id())
37
+ print(devices[x].get_hostname())
38
+ print("-------------------------------------")
39
+
40
+ # set some values
41
+ print(devices[0].set_name("Hovedsoverom"))
42
+ print(devices[0].set_target_temperature(22.5))
43
+ print(devices[0].set_target_temperature_high(30))
44
+ print(devices[0].set_target_temperature_low(5))
45
+ print(devices[0].set_week_program(0))
46
+ print(devices[0].set_operation_mode(0))
47
+ ```
48
+
49
+ For a more ex
50
+
51
+ ## Contributing
52
+
53
+ Contributions to `pytouchline_extended` are welcome! You are welcome to create issues or pull requests.
54
+
55
+ ## License
56
+
57
+ `pytouchline_extended` is licensed under the MIT License. See [LICENSE](LICENSE) for more information.
58
+ ```
@@ -6,9 +6,17 @@ __author__ = 'brondum'
6
6
 
7
7
 
8
8
  class PyTouchline(object):
9
- def __init__(self, id=0, ip_address=""):
9
+ """
10
+ A Python interface for controlling a Roth Touchline heat pump controller.
11
+
12
+ Attributes:
13
+ id (int): The ID of the sensor.
14
+ url (str): The URL of the heat pump controller.
15
+ """
16
+
17
+ def __init__(self, id=0, url=""):
10
18
  self._id = id
11
- self._ip_address = ip_address
19
+ self._url = url
12
20
  self._temp_scale = 100
13
21
  self._header = {"Content-Type": "text/xml"}
14
22
  self._read_path = "/cgi-bin/ILRReadValues.cgi"
@@ -60,6 +68,7 @@ class PyTouchline(object):
60
68
  response = self._request_and_receive_xml(request)
61
69
  return self._parse_number_of_devices(response)
62
70
 
71
+ # update the roth touchline device, and parse desc, id etc.
63
72
  def update(self):
64
73
  device_items = self._get_touchline_device_item(self._id)
65
74
  request = self._get_touchline_request(device_items)
@@ -102,7 +111,7 @@ class PyTouchline(object):
102
111
  try:
103
112
  h = httplib2.Http()
104
113
  (resp, content) = h.request(
105
- uri=self._ip_address +
114
+ uri=self._url +
106
115
  self._write_path + "?" +
107
116
  "G" + str(self._parameter["Unique ID"]) +
108
117
  "." + str(parameter) + "=" + str(value),
@@ -120,7 +129,7 @@ class PyTouchline(object):
120
129
  try:
121
130
  h = httplib2.Http()
122
131
  (resp, content) = h.request(
123
- uri=self._ip_address + self._read_path,
132
+ uri=self._url + self._read_path,
124
133
  method="POST",
125
134
  body=req_key,
126
135
  headers=self._header
@@ -1,18 +1,17 @@
1
1
  Metadata-Version: 2.1
2
- Name: pytouchline-extended
3
- Version: 0.4
2
+ Name: pytouchline_extended
3
+ Version: 0.4.2
4
4
  Summary: A Roth Touchline interface library
5
5
  Home-page: https://github.com/brondum/pytouchline
6
6
  Author: Peter Brondum
7
7
  License: MIT
8
- Download-URL: https://github.com/brondum/pytouchline/archive/0.4.tar.gz
9
8
  Keywords: Roth,Touchline,Home Assistant,hassio,Heat pump
10
- Platform: UNKNOWN
11
9
  Classifier: Development Status :: 3 - Alpha
12
10
  Classifier: Intended Audience :: Developers
13
11
  Classifier: License :: OSI Approved :: MIT License
14
12
  Classifier: Programming Language :: Python :: 3
15
13
  License-File: LICENSE
14
+ Requires-Dist: httplib2
15
+ Requires-Dist: faust-cchardet
16
16
 
17
- UNKNOWN
18
-
17
+ A simple helper library for controlling a Roth Touchline heat pump controller
@@ -7,4 +7,5 @@ pytouchline_extended.egg-info/PKG-INFO
7
7
  pytouchline_extended.egg-info/SOURCES.txt
8
8
  pytouchline_extended.egg-info/dependency_links.txt
9
9
  pytouchline_extended.egg-info/requires.txt
10
- pytouchline_extended.egg-info/top_level.txt
10
+ pytouchline_extended.egg-info/top_level.txt
11
+ tests/test_main.py
@@ -2,12 +2,12 @@ from setuptools import setup
2
2
  setup(
3
3
  name = 'pytouchline_extended',
4
4
  packages = ['pytouchline_extended'],
5
- version = '0.4',
5
+ version = "0.4.2",
6
6
  description = 'A Roth Touchline interface library',
7
+ long_description="A simple helper library for controlling a Roth Touchline heat pump controller",
7
8
  author = 'Peter Brondum',
8
9
  license='MIT',
9
10
  url = 'https://github.com/brondum/pytouchline',
10
- download_url = 'https://github.com/brondum/pytouchline/archive/0.4.tar.gz',
11
11
  keywords = ['Roth', 'Touchline', 'Home Assistant', 'hassio', "Heat pump"],
12
12
  classifiers = [
13
13
  'Development Status :: 3 - Alpha',
@@ -0,0 +1,7 @@
1
+ import pytest
2
+ from pytouchline_extended import PyTouchline
3
+
4
+ def test_init():
5
+ touchline = PyTouchline(id=1, url="http://192.168.1.254")
6
+ assert touchline._id == 1
7
+ assert touchline._url == "http://192.168.1.254"
@@ -1,17 +0,0 @@
1
- # Python Library for Roth Touchline
2
-
3
- A simple helper library for controlling a Roth Touchline heat pump controller
4
-
5
- ```py
6
-
7
- from pytouchline_extended import PyTouchline
8
-
9
- py_touchline = PyTouchline(ip_address="http://192.168.1.254")
10
-
11
- numberOfDevices = py_touchline.get_number_of_devices()
12
- device1 = PyTouchline(id=1)
13
- device1.update()
14
- print(device1.get_name())
15
- print(device1.get_current_temperature())
16
- print(device1.get_target_temperature())
17
- ```