pytouchlinesl 0.1.1__tar.gz → 0.1.3__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.
Files changed (22) hide show
  1. {pytouchlinesl-0.1.1/pytouchlinesl.egg-info → pytouchlinesl-0.1.3}/PKG-INFO +10 -2
  2. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/README.md +8 -0
  3. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pyproject.toml +2 -2
  4. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl/client/client.py +18 -6
  5. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl/client/models/models.py +4 -1
  6. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3/pytouchlinesl.egg-info}/PKG-INFO +10 -2
  7. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl.egg-info/requires.txt +1 -1
  8. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/LICENSE +0 -0
  9. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl/__init__.py +0 -0
  10. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl/client/__init__.py +0 -0
  11. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl/client/base.py +0 -0
  12. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl/client/models/__init__.py +0 -0
  13. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl/module.py +0 -0
  14. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl/touchlinesl.py +0 -0
  15. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl/zone.py +0 -0
  16. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl.egg-info/SOURCES.txt +0 -0
  17. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl.egg-info/dependency_links.txt +0 -0
  18. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/pytouchlinesl.egg-info/top_level.txt +0 -0
  19. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/setup.cfg +0 -0
  20. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/tests/test_module.py +0 -0
  21. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/tests/test_touchlinesl.py +0 -0
  22. {pytouchlinesl-0.1.1 → pytouchlinesl-0.1.3}/tests/test_zone.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytouchlinesl
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: An API client for Roth's TouchlineSL control system.
5
5
  Author-email: Jon Seager <jon@sgrs.uk>
6
6
  Project-URL: Homepage, https://github.com/jnsgruk/pytouchlinesl
@@ -12,7 +12,7 @@ Requires-Python: >=3.10
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
14
  Requires-Dist: aiohttp
15
- Requires-Dist: pydantic>=2.8.2
15
+ Requires-Dist: pydantic
16
16
  Provides-Extra: dev
17
17
  Requires-Dist: pytest; extra == "dev"
18
18
  Requires-Dist: pytest-asyncio; extra == "dev"
@@ -52,6 +52,14 @@ the result is cached for 30 seconds. Any POST requests made (setting temperature
52
52
  to schedules) will invalidate the cache, and all GET methods have a `refresh` argument that can be
53
53
  used to force a refresh of the underlying data.
54
54
 
55
+ ## Installation
56
+
57
+ The package can be installed from PyPi as usual:
58
+
59
+ ```bash
60
+ pip install pytouchlinesl
61
+ ```
62
+
55
63
  ## Example Usage
56
64
 
57
65
  ```python
@@ -32,6 +32,14 @@ the result is cached for 30 seconds. Any POST requests made (setting temperature
32
32
  to schedules) will invalidate the cache, and all GET methods have a `refresh` argument that can be
33
33
  used to force a refresh of the underlying data.
34
34
 
35
+ ## Installation
36
+
37
+ The package can be installed from PyPi as usual:
38
+
39
+ ```bash
40
+ pip install pytouchlinesl
41
+ ```
42
+
35
43
  ## Example Usage
36
44
 
37
45
  ```python
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pytouchlinesl"
3
- version = "0.1.1"
3
+ version = "0.1.3"
4
4
  authors = [{ name = "Jon Seager", email = "jon@sgrs.uk" }]
5
5
  description = "An API client for Roth's TouchlineSL control system."
6
6
  readme = "README.md"
@@ -10,7 +10,7 @@ classifiers = [
10
10
  "License :: OSI Approved :: Apache Software License",
11
11
  "Operating System :: OS Independent",
12
12
  ]
13
- dependencies = ["aiohttp", "pydantic>=2.8.2"]
13
+ dependencies = ["aiohttp", "pydantic"]
14
14
 
15
15
  [project.optional-dependencies]
16
16
  dev = ["pytest", "pytest-asyncio", "ruff"]
@@ -131,6 +131,22 @@ class RothAPI(BaseClient):
131
131
  or z.zone.id == zone_id
132
132
  ]
133
133
 
134
+ # pydantic v1 compatibility
135
+ try:
136
+ p0_intervals = [
137
+ i.dict(by_alias=True) for i in schedule.p0_intervals if i.start != 6100
138
+ ]
139
+ p1_intervals = [
140
+ i.dict(by_alias=True) for i in schedule.p1_intervals if i.start != 6100
141
+ ]
142
+ except AttributeError:
143
+ p0_intervals = [
144
+ i.model_dump(by_alias=True) for i in schedule.p0_intervals if i.start != 6100
145
+ ]
146
+ p1_intervals = [
147
+ i.model_dump(by_alias=True) for i in schedule.p1_intervals if i.start != 6100
148
+ ]
149
+
134
150
  # TODO: This be simplified with Pydantic models
135
151
  data = {
136
152
  "scheduleName": schedule.name,
@@ -142,14 +158,10 @@ class RothAPI(BaseClient):
142
158
  "p0SetbackTemp": schedule.p0_setback_temp,
143
159
  # Empty intervals start/end with a value of 6100, which is invalid
144
160
  # if sent in this request.
145
- "p0Intervals": [
146
- i.model_dump(by_alias=True) for i in schedule.p0_intervals if i.start != 6100
147
- ],
161
+ "p0Intervals": p0_intervals,
148
162
  "p1Days": schedule.p1_days,
149
163
  "p1SetbackTemp": schedule.p1_setback_temp,
150
- "p1Intervals": [
151
- i.model_dump(by_alias=True) for i in schedule.p1_intervals if i.start != 6100
152
- ],
164
+ "p1Intervals": p1_intervals,
153
165
  },
154
166
  }
155
167
 
@@ -6,7 +6,10 @@ tweaks to types and names.
6
6
 
7
7
  from typing import Any, Dict, List, Literal, Optional
8
8
 
9
- from pydantic import BaseModel, Field
9
+ try:
10
+ from pydantic.v1 import BaseModel, Field
11
+ except ImportError:
12
+ from pydantic import BaseModel, Field
10
13
 
11
14
 
12
15
  class ZoneFlagsModel(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytouchlinesl
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: An API client for Roth's TouchlineSL control system.
5
5
  Author-email: Jon Seager <jon@sgrs.uk>
6
6
  Project-URL: Homepage, https://github.com/jnsgruk/pytouchlinesl
@@ -12,7 +12,7 @@ Requires-Python: >=3.10
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
14
  Requires-Dist: aiohttp
15
- Requires-Dist: pydantic>=2.8.2
15
+ Requires-Dist: pydantic
16
16
  Provides-Extra: dev
17
17
  Requires-Dist: pytest; extra == "dev"
18
18
  Requires-Dist: pytest-asyncio; extra == "dev"
@@ -52,6 +52,14 @@ the result is cached for 30 seconds. Any POST requests made (setting temperature
52
52
  to schedules) will invalidate the cache, and all GET methods have a `refresh` argument that can be
53
53
  used to force a refresh of the underlying data.
54
54
 
55
+ ## Installation
56
+
57
+ The package can be installed from PyPi as usual:
58
+
59
+ ```bash
60
+ pip install pytouchlinesl
61
+ ```
62
+
55
63
  ## Example Usage
56
64
 
57
65
  ```python
@@ -1,5 +1,5 @@
1
1
  aiohttp
2
- pydantic>=2.8.2
2
+ pydantic
3
3
 
4
4
  [dev]
5
5
  pytest
File without changes
File without changes