python-tado 0.18.4__tar.gz → 0.18.5__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 (34) hide show
  1. {python_tado-0.18.4/python_tado.egg-info → python_tado-0.18.5}/PKG-INFO +101 -18
  2. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/http.py +8 -0
  3. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/interface/api/my_tado.py +15 -0
  4. python_tado-0.18.5/PyTado/interface/interface.py +298 -0
  5. python_tado-0.18.5/README.md +111 -0
  6. {python_tado-0.18.4 → python_tado-0.18.5}/pyproject.toml +6 -2
  7. {python_tado-0.18.4 → python_tado-0.18.5/python_tado.egg-info}/PKG-INFO +101 -18
  8. {python_tado-0.18.4 → python_tado-0.18.5}/python_tado.egg-info/requires.txt +5 -0
  9. {python_tado-0.18.4 → python_tado-0.18.5}/tests/test_my_tado.py +13 -0
  10. python_tado-0.18.4/PyTado/interface/interface.py +0 -39
  11. python_tado-0.18.4/README.md +0 -32
  12. {python_tado-0.18.4 → python_tado-0.18.5}/AUTHORS +0 -0
  13. {python_tado-0.18.4 → python_tado-0.18.5}/LICENSE +0 -0
  14. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/__init__.py +0 -0
  15. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/__main__.py +0 -0
  16. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/const.py +0 -0
  17. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/exceptions.py +0 -0
  18. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/interface/__init__.py +0 -0
  19. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/interface/api/__init__.py +0 -0
  20. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/interface/api/hops_tado.py +0 -0
  21. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/logger.py +0 -0
  22. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/zone/__init__.py +0 -0
  23. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/zone/hops_zone.py +0 -0
  24. {python_tado-0.18.4 → python_tado-0.18.5}/PyTado/zone/my_zone.py +0 -0
  25. {python_tado-0.18.4 → python_tado-0.18.5}/python_tado.egg-info/SOURCES.txt +0 -0
  26. {python_tado-0.18.4 → python_tado-0.18.5}/python_tado.egg-info/dependency_links.txt +0 -0
  27. {python_tado-0.18.4 → python_tado-0.18.5}/python_tado.egg-info/entry_points.txt +0 -0
  28. {python_tado-0.18.4 → python_tado-0.18.5}/python_tado.egg-info/not-zip-safe +0 -0
  29. {python_tado-0.18.4 → python_tado-0.18.5}/python_tado.egg-info/top_level.txt +0 -0
  30. {python_tado-0.18.4 → python_tado-0.18.5}/setup.cfg +0 -0
  31. {python_tado-0.18.4 → python_tado-0.18.5}/tests/test_hops_zone.py +0 -0
  32. {python_tado-0.18.4 → python_tado-0.18.5}/tests/test_http.py +0 -0
  33. {python_tado-0.18.4 → python_tado-0.18.5}/tests/test_my_zone.py +0 -0
  34. {python_tado-0.18.4 → python_tado-0.18.5}/tests/test_tado_interface.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-tado
3
- Version: 0.18.4
3
+ Version: 0.18.5
4
4
  Summary: PyTado from chrism0dwk, modfied by w.malgadey, diplix, michaelarnauts, LenhartStephan, splifter, syssi, andersonshatch, Yippy, p0thi, Coffee2CodeNL, chiefdragon, FilBr, nikilase, albertomontesg, Moritz-Schmidt, palazzem
5
5
  Author-email: Chris Jewell <chrism0dwk@gmail.com>, "w.malgadey" <w.malgadey@gmail.com>, FilBr <filippo.barba@protonmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -696,43 +696,126 @@ License-File: AUTHORS
696
696
  Requires-Dist: requests
697
697
  Provides-Extra: dev
698
698
  Requires-Dist: black>=24.3; extra == "dev"
699
+ Requires-Dist: pre-commit; extra == "dev"
699
700
  Requires-Dist: pytype; extra == "dev"
700
701
  Requires-Dist: pylint; extra == "dev"
701
702
  Requires-Dist: types-requests; extra == "dev"
703
+ Requires-Dist: requests; extra == "dev"
702
704
  Requires-Dist: responses; extra == "dev"
703
705
  Requires-Dist: coverage; extra == "dev"
704
706
  Requires-Dist: pytest; extra == "dev"
705
707
  Requires-Dist: pytest-cov; extra == "dev"
708
+ Provides-Extra: all
709
+ Requires-Dist: python-tado[dev]; extra == "all"
706
710
 
707
- PyTado -- Pythonize your central heating
708
- ========================================
711
+ # PyTado -- Pythonize your central heating
709
712
 
710
- Author: Chris Jewell <chrism0dwk@gmail.com>
711
- Modified: Wolfgang Malgadey <wolfgang@malgadey.de>
713
+ [![Linting and testing](https://github.com/wmalgadey/PyTado/actions/workflows/lint-and-test-matrix.yml/badge.svg)](https://github.com/wmalgadey/PyTado/actions/workflows/lint-and-test-matrix.yml)
714
+ [![Build and deploy to pypi](https://github.com/wmalgadey/PyTado/actions/workflows/publish-to-pypi.yml/badge.svg)](https://github.com/wmalgadey/PyTado/actions/workflows/publish-to-pypi.yml)
715
+ [![PyPI version](https://badge.fury.io/py/python-tado.svg)](https://badge.fury.io/py/python-tado)
716
+
717
+ PyTado is a Python module implementing an interface to the Tado web API. It allows a user to interact with their
718
+ Tado heating system for the purposes of monitoring or controlling their heating system, beyond what Tado themselves
719
+ currently offer.
720
+
721
+ It is hoped that this module might be used by those who wish to tweak their Tado systems, and further optimise their
722
+ heating setups.
723
+
724
+ ---
725
+
726
+ Original author: Chris Jewell <chrism0dwk@gmail.com>
712
727
 
713
728
  Licence: GPL v3
714
729
 
715
730
  Copyright: Chris Jewell 2016-2018
716
731
 
717
- PyTado is a Python module implementing an interface to the Tado web API. It allows a user to interact with their Tado heating system for the purposes of monitoring or controlling their heating system, beyond what Tado themselves currently offer.
732
+ ## Disclaimer
718
733
 
719
- It is hoped that this module might be used by those who wish to tweak their Tado systems, and further optimise their heating setups.
734
+ Besides owning a Tado system, I have no connection with the Tado company themselves. PyTado was created for my own use,
735
+ and for others who may wish to experiment with personal Internet of Things systems. I receive no help (financial or
736
+ otherwise) from Tado, and have no business interest with them. This software is provided without warranty, according to
737
+ the GNU Public Licence version 3, and should therefore not be used where it may endanger life, financial stakes, or
738
+ cause discomfort and inconvenience to others.
720
739
 
721
- Disclaimer
722
- ----------
723
- Besides owning a Tado system, I have no connection with the Tado company themselves. PyTado was created for my own use, and for others who may wish to experiment with personal Internet of Things systems. I receive no help (financial or otherwise) from Tado, and have no business interest with them. This software is provided without warranty, according to the GNU Public Licence version 3, and should therefore not be used where it may endanger life, financial stakes, or cause discomfort and inconvenience to others.
724
-
725
- Example basic usage
726
- -------------------
740
+ ## Example basic usage
727
741
 
728
742
  >>> from PyTado.interface import Tado
729
743
  >>> t = Tado('my@username.com', 'mypassword')
730
744
  >>> climate = t.get_climate(zone=1)
731
745
 
732
- Development
733
- -----------
734
- This software is at a purely experimental stage. If you're interested and can write Python, clone the Github repo, drop me a line, and get involved!
746
+ ## Contributing
747
+
748
+ We are very open to the community's contributions - be it a quick fix of a typo, or a completely new feature!
749
+
750
+ You don't need to be a Python expert to provide meaningful improvements. To learn how to get started, check out our
751
+ [Contributor Guidelines](https://github.com/wmalgadey/econnect-python/blob/main/CONTRIBUTING.md) first, and ask for help
752
+ in [GitHub Discussions](https://github.com/wmalgadey/PyTado/discussions) if you have questions.
753
+
754
+ ## Development
755
+
756
+ We welcome external contributions, even though the project was initially intended for personal use. If you think some
757
+ parts could be exposed with a more generic interface, please open a [GitHub issue](https://github.com/wmalgadey/PyTado/issues)
758
+ to discuss your suggestion.
759
+
760
+ ### Dev Environment
761
+
762
+ To contribute to this repository, you should first clone your fork and then setup your development environment. Clone
763
+ your repository as follows (replace yourusername with your GitHub account name):
764
+
765
+ ```bash
766
+ git clone https://github.com/yourusername/PyTado.git
767
+ cd PyTado
768
+ ```
769
+
770
+ Then, to create your development environment and install the project with its dependencies, execute the following
771
+ commands in your terminal:
772
+
773
+ ```bash
774
+ # Create and activate a new virtual environment
775
+ python3 -m venv venv
776
+ source venv/bin/activate
777
+
778
+ # Upgrade pip and install all projects and their dependencies
779
+ pip install --upgrade pip
780
+ pip install -e '.[all]'
781
+
782
+ # Install pre-commit hooks
783
+ pre-commit install
784
+ ```
785
+
786
+ ### Coding Guidelines
787
+
788
+ To maintain a consistent codebase, we utilize [black][1]. Consistency is crucial as it helps readability, reduces errors,
789
+ and facilitates collaboration among developers.
790
+
791
+ To ensure that every commit adheres to our coding standards, we've integrated [pre-commit hooks][2]. These hooks
792
+ automatically run `black` before each commit, ensuring that all code changes are automatically checked and formatted.
793
+
794
+ For details on how to set up your development environment to make use of these hooks, please refer to the
795
+ [Development][3] section of our documentation.
796
+
797
+ [1]: https://github.com/ambv/black
798
+ [2]: https://pre-commit.com/
799
+ [3]: https://github.com/wmalgadey/PyTado#development
800
+
801
+ ### Testing
802
+
803
+ Ensuring the robustness and reliability of our code is paramount. Therefore, all contributions must include at least one
804
+ test to verify the intended behavior.
805
+
806
+ To run tests locally, execute the test suite using `pytest` with the following command:
807
+
808
+ ```bash
809
+ pytest tests/ --cov --cov-branch -vv
810
+ ```
811
+
812
+ ---
735
813
 
736
- Best wishes and a warm winter to all!
814
+ A message from the original author:
737
815
 
738
- Chris Jewell
816
+ > This software is at a purely experimental stage. If you're interested and can write Python, clone the Github repo,
817
+ > drop me a line, and get involved!
818
+ >
819
+ > Best wishes and a warm winter to all!
820
+ >
821
+ > Chris Jewell
@@ -8,6 +8,7 @@ import logging
8
8
  import pprint
9
9
  from datetime import datetime, timedelta
10
10
  from typing import Any
11
+ from urllib.parse import urlencode
11
12
 
12
13
  import requests
13
14
 
@@ -27,6 +28,7 @@ class Endpoint(enum.StrEnum):
27
28
  EIQ = "https://energy-insights.tado.com/api/"
28
29
  TARIFF = "https://tariff-experience.tado.com/api/"
29
30
  GENIE = "https://genie.tado.com/api/v2/"
31
+ MINDER = "https://minder.tado.com/v1/"
30
32
 
31
33
 
32
34
  class Domain(enum.StrEnum):
@@ -65,6 +67,7 @@ class TadoRequest:
65
67
  domain: Domain = Domain.HOME,
66
68
  device: int | None = None,
67
69
  mode: Mode = Mode.OBJECT,
70
+ params: dict[str, Any] | None = None,
68
71
  ):
69
72
  self.endpoint = endpoint
70
73
  self.command = command
@@ -73,6 +76,7 @@ class TadoRequest:
73
76
  self.domain = domain
74
77
  self.device = device
75
78
  self.mode = mode
79
+ self.params = params
76
80
 
77
81
 
78
82
  class TadoXRequest(TadoRequest):
@@ -87,6 +91,7 @@ class TadoXRequest(TadoRequest):
87
91
  domain: Domain = Domain.HOME,
88
92
  device: int | None = None,
89
93
  mode: Mode = Mode.OBJECT,
94
+ params: dict[str, Any] | None = None,
90
95
  ):
91
96
  super().__init__(
92
97
  endpoint=endpoint,
@@ -96,6 +101,7 @@ class TadoXRequest(TadoRequest):
96
101
  domain=domain,
97
102
  device=device,
98
103
  mode=mode,
104
+ params=params,
99
105
  )
100
106
  self._action = action
101
107
 
@@ -214,6 +220,8 @@ class Http:
214
220
  url = f"{request.endpoint}{request.domain}/{request.device}/{request.command}"
215
221
  elif request.domain == Domain.ME:
216
222
  url = f"{request.endpoint}{request.domain}"
223
+ elif request.endpoint == Endpoint.MINDER:
224
+ url = f"{request.endpoint}{request.domain}/{self.id:d}/{request.command}?{urlencode(request.params)}"
217
225
  else:
218
226
  url = f"{request.endpoint}{request.domain}/{self._id:d}/{request.command}"
219
227
  return url
@@ -621,3 +621,18 @@ class Tado:
621
621
  request.payload = {"circuitNumber": heating_circuit}
622
622
 
623
623
  return self._http.request(request)
624
+
625
+ def get_running_times(
626
+ self, date=datetime.datetime.now().strftime("%Y-%m-%d")
627
+ ) -> dict:
628
+ """
629
+ Get the running times from the Minder API
630
+ """
631
+
632
+ request = TadoRequest()
633
+ request.command = "runningTimes"
634
+ request.action = Action.GET
635
+ request.endpoint = Endpoint.MINDER
636
+ request.params = {"from": date}
637
+
638
+ return self._http.request(request)
@@ -0,0 +1,298 @@
1
+ """
2
+ PyTado interface abstraction to use app.tado.com or hops.tado.com
3
+ """
4
+
5
+ import datetime
6
+ import warnings
7
+ import functools
8
+
9
+ from PyTado.http import Http
10
+ import PyTado.interface.api as API
11
+
12
+
13
+ def deprecated(new_func_name):
14
+ def decorator(func):
15
+ @functools.wraps(func)
16
+ def wrapper(*args, **kwargs):
17
+ warnings.warn(
18
+ f"The '{func.__name__}' method is deprecated, use '{new_func_name}' instead. "
19
+ "Deprecated methods will be removed with 1.0.0.",
20
+ DeprecationWarning,
21
+ stacklevel=2,
22
+ )
23
+ return getattr(args[0], new_func_name)(*args, **kwargs)
24
+
25
+ return wrapper
26
+
27
+ return decorator
28
+
29
+
30
+ class Tado:
31
+ """Interacts with a Tado thermostat via public API.
32
+
33
+ Example usage: t = Tado('me@somewhere.com', 'mypasswd')
34
+ t.get_climate(1) # Get climate, zone 1.
35
+ """
36
+
37
+ def __init__(
38
+ self,
39
+ username: str,
40
+ password: str,
41
+ http_session=None,
42
+ debug: bool = False,
43
+ ):
44
+ """Class Constructor"""
45
+
46
+ self._http = Http(
47
+ username=username,
48
+ password=password,
49
+ http_session=http_session,
50
+ debug=debug,
51
+ )
52
+
53
+ if self._http.is_x_line:
54
+ self._api = API.TadoX(http=self._http, debug=debug)
55
+ else:
56
+ self._api = API.Tado(http=self._http, debug=debug)
57
+
58
+ def __getattr__(self, name):
59
+ """Delegiert den Aufruf von Methoden an die richtige API-Client-Implementierung."""
60
+ return getattr(self._api, name)
61
+
62
+ # region Deprecated Methods
63
+ # pylint: disable=invalid-name
64
+
65
+ @deprecated("get_me")
66
+ def getMe(self):
67
+ """Gets home information. (deprecated)"""
68
+ return self.get_me()
69
+
70
+ @deprecated("get_devices")
71
+ def getDevices(self):
72
+ """Gets device information. (deprecated)"""
73
+ return self.get_devices()
74
+
75
+ @deprecated("get_zones")
76
+ def getZones(self):
77
+ """Gets zones information. (deprecated)"""
78
+ return self.get_zones()
79
+
80
+ @deprecated("get_zone_state")
81
+ def getZoneState(self, zone):
82
+ """Gets current state of Zone as a TadoZone object. (deprecated)"""
83
+ return self.get_zone_state(zone)
84
+
85
+ @deprecated("get_zone_states")
86
+ def getZoneStates(self):
87
+ """Gets current states of all zones. (deprecated)"""
88
+ return self.get_zone_states()
89
+
90
+ @deprecated("get_state")
91
+ def getState(self, zone):
92
+ """Gets current state of Zone. (deprecated)"""
93
+ return self.get_state(zone)
94
+
95
+ @deprecated("get_home_state")
96
+ def getHomeState(self):
97
+ """Gets current state of Home. (deprecated)"""
98
+ return self.get_home_state()
99
+
100
+ @deprecated("get_auto_geofencing_supported")
101
+ def getAutoGeofencingSupported(self):
102
+ """Return whether the Tado Home supports auto geofencing (deprecated)"""
103
+ return self.get_auto_geofencing_supported()
104
+
105
+ @deprecated("get_capabilities")
106
+ def getCapabilities(self, zone):
107
+ """Gets current capabilities of Zone zone. (deprecated)"""
108
+ return self.get_capabilities(zone)
109
+
110
+ @deprecated("get_climate")
111
+ def getClimate(self, zone):
112
+ """Gets temp (centigrade) and humidity (% RH) for Zone zone. (deprecated)"""
113
+ return self.get_climate(zone)
114
+
115
+ @deprecated("get_timetable")
116
+ def getTimetable(self, zone):
117
+ """Get the Timetable type currently active (Deprecated)"""
118
+ return self.get_timetable(zone)
119
+
120
+ @deprecated("get_historic")
121
+ def getHistoric(self, zone, date):
122
+ """Gets historic information on given date for zone. (Deprecated)"""
123
+ return self.get_historic(zone, date)
124
+
125
+ @deprecated("set_timetable")
126
+ def setTimetable(self, zone, _id):
127
+ """Set the Timetable type currently active (Deprecated)
128
+ id = 0 : ONE_DAY (MONDAY_TO_SUNDAY)
129
+ id = 1 : THREE_DAY (MONDAY_TO_FRIDAY, SATURDAY, SUNDAY)
130
+ id = 3 : SEVEN_DAY (MONDAY, TUESDAY, WEDNESDAY ...)"""
131
+ return self.set_timetable(zone, _id)
132
+
133
+ @deprecated("get_schedule")
134
+ def getSchedule(self, zone, _id, day=None):
135
+ """Get the JSON representation of the schedule for a zone. Zone has 3 different schedules,
136
+ one for each timetable (see setTimetable)"""
137
+ return self.get_schedule(zone, _id, day)
138
+
139
+ @deprecated("set_schedule")
140
+ def setSchedule(self, zone, _id, day, data):
141
+ """Set the schedule for a zone, day is required"""
142
+ return self.set_schedule(zone, _id, day, data)
143
+
144
+ @deprecated("get_weather")
145
+ def getWeather(self):
146
+ """Gets outside weather data (Deprecated)"""
147
+ return self.get_weather()
148
+
149
+ @deprecated("get_air_comfort")
150
+ def getAirComfort(self):
151
+ """Gets air quality information (Deprecated)"""
152
+ return self.get_air_comfort()
153
+
154
+ @deprecated("get_users")
155
+ def getAppUsers(self):
156
+ """Gets getAppUsers data (deprecated)"""
157
+ return self.get_app_user()
158
+
159
+ @deprecated("get_mobile_devices")
160
+ def getMobileDevices(self):
161
+ """Gets information about mobile devices (Deprecated)"""
162
+ return self.get_mobile_devices()
163
+
164
+ @deprecated("reset_zone_overlay")
165
+ def resetZoneOverlay(self, zone):
166
+ """Delete current overlay (Deprecated)"""
167
+ return self.reset_zone_overlay(zone)
168
+
169
+ @deprecated("set_zone_overlay")
170
+ def setZoneOverlay(
171
+ self,
172
+ zone,
173
+ overlayMode,
174
+ setTemp=None,
175
+ duration=None,
176
+ deviceType="HEATING",
177
+ power="ON",
178
+ mode=None,
179
+ fanSpeed=None,
180
+ swing=None,
181
+ fanLevel=None,
182
+ verticalSwing=None,
183
+ horizontalSwing=None,
184
+ ):
185
+ """Set current overlay for a zone (Deprecated)"""
186
+ return self.set_zone_overlay(
187
+ zone,
188
+ overlay_mode=overlayMode,
189
+ set_temp=setTemp,
190
+ duration=duration,
191
+ device_type=deviceType,
192
+ power=power,
193
+ mode=mode,
194
+ fan_speed=fanSpeed,
195
+ swing=swing,
196
+ fan_level=fanLevel,
197
+ vertical_swing=verticalSwing,
198
+ horizontal_swing=horizontalSwing,
199
+ )
200
+
201
+ @deprecated("get_zone_overlay_default")
202
+ def getZoneOverlayDefault(self, zone):
203
+ """Get current overlay default settings for zone. (Deprecated)"""
204
+ return self.get_zone_overlay_default(zone)
205
+
206
+ @deprecated("set_home")
207
+ def setHome(self):
208
+ """Sets HomeState to HOME (Deprecated)"""
209
+ return self.set_home()
210
+
211
+ @deprecated("set_away")
212
+ def setAway(self):
213
+ """Sets HomeState to AWAY (Deprecated)"""
214
+ return self.set_away()
215
+
216
+ @deprecated("change_presence")
217
+ def changePresence(self, presence):
218
+ """Sets HomeState to presence (Deprecated)"""
219
+ return self.change_presence(presence=presence)
220
+
221
+ @deprecated("set_auto")
222
+ def setAuto(self):
223
+ """Sets HomeState to AUTO (Deprecated)"""
224
+ return self.set_auto()
225
+
226
+ @deprecated("get_window_state")
227
+ def getWindowState(self, zone):
228
+ """Returns the state of the window for zone (Deprecated)"""
229
+ return self.get_window_state(zone=zone)
230
+
231
+ @deprecated("get_open_window_detected")
232
+ def getOpenWindowDetected(self, zone):
233
+ """Returns whether an open window is detected. (Deprecated)"""
234
+ return self.get_open_window_detected(zone=zone)
235
+
236
+ @deprecated("set_open_window")
237
+ def setOpenWindow(self, zone):
238
+ """Sets the window in zone to open (Deprecated)"""
239
+ return self.set_open_window(zone=zone)
240
+
241
+ @deprecated("reset_open_window")
242
+ def resetOpenWindow(self, zone):
243
+ """Sets the window in zone to closed (Deprecated)"""
244
+ return self.reset_open_window(zone=zone)
245
+
246
+ @deprecated("get_device_info")
247
+ def getDeviceInfo(self, device_id, cmd=""):
248
+ """Gets information about devices
249
+ with option to get specific info i.e. cmd='temperatureOffset' (Deprecated)
250
+ """
251
+ return self.get_device_info(device_id=device_id, cmd=cmd)
252
+
253
+ @deprecated("set_temp_offset")
254
+ def setTempOffset(self, device_id, offset=0, measure="celsius"):
255
+ """Set the Temperature offset on the device. (Deprecated)"""
256
+ return self.set_temp_offset(
257
+ device_id=device_id, offset=offset, measure=measure
258
+ )
259
+
260
+ @deprecated("get_eiq_tariffs")
261
+ def getEIQTariffs(self):
262
+ """Get Energy IQ tariff history (Deprecated)"""
263
+ return self.get_eiq_tariffs()
264
+
265
+ @deprecated("get_eiq_meter_readings")
266
+ def getEIQMeterReadings(self):
267
+ """Get Energy IQ meter readings (Deprecated)"""
268
+ return self.get_eiq_meter_readings()
269
+
270
+ @deprecated("set_eiq_meter_readings")
271
+ def setEIQMeterReadings(
272
+ self, date=datetime.datetime.now().strftime("%Y-%m-%d"), reading=0
273
+ ):
274
+ """Send Meter Readings to Tado, date format is YYYY-MM-DD, reading is without decimals (Deprecated)"""
275
+ return self.set_eiq_meter_readings(date=date, reading=reading)
276
+
277
+ @deprecated("set_eiq_tariff")
278
+ def setEIQTariff(
279
+ self,
280
+ from_date=datetime.datetime.now().strftime("%Y-%m-%d"),
281
+ to_date=datetime.datetime.now().strftime("%Y-%m-%d"),
282
+ tariff=0,
283
+ unit="m3",
284
+ is_period=False,
285
+ ):
286
+ """Send Tariffs to Tado, date format is YYYY-MM-DD,
287
+ tariff is with decimals, unit is either m3 or kWh, set is_period to true to set a period of price (Deprecated)
288
+ """
289
+ return self.set_eiq_tariff(
290
+ from_date=from_date,
291
+ to_date=to_date,
292
+ tariff=tariff,
293
+ unit=unit,
294
+ is_period=is_period,
295
+ )
296
+
297
+ # pylint: enable=invalid-name
298
+ # endregion
@@ -0,0 +1,111 @@
1
+ # PyTado -- Pythonize your central heating
2
+
3
+ [![Linting and testing](https://github.com/wmalgadey/PyTado/actions/workflows/lint-and-test-matrix.yml/badge.svg)](https://github.com/wmalgadey/PyTado/actions/workflows/lint-and-test-matrix.yml)
4
+ [![Build and deploy to pypi](https://github.com/wmalgadey/PyTado/actions/workflows/publish-to-pypi.yml/badge.svg)](https://github.com/wmalgadey/PyTado/actions/workflows/publish-to-pypi.yml)
5
+ [![PyPI version](https://badge.fury.io/py/python-tado.svg)](https://badge.fury.io/py/python-tado)
6
+
7
+ PyTado is a Python module implementing an interface to the Tado web API. It allows a user to interact with their
8
+ Tado heating system for the purposes of monitoring or controlling their heating system, beyond what Tado themselves
9
+ currently offer.
10
+
11
+ It is hoped that this module might be used by those who wish to tweak their Tado systems, and further optimise their
12
+ heating setups.
13
+
14
+ ---
15
+
16
+ Original author: Chris Jewell <chrism0dwk@gmail.com>
17
+
18
+ Licence: GPL v3
19
+
20
+ Copyright: Chris Jewell 2016-2018
21
+
22
+ ## Disclaimer
23
+
24
+ Besides owning a Tado system, I have no connection with the Tado company themselves. PyTado was created for my own use,
25
+ and for others who may wish to experiment with personal Internet of Things systems. I receive no help (financial or
26
+ otherwise) from Tado, and have no business interest with them. This software is provided without warranty, according to
27
+ the GNU Public Licence version 3, and should therefore not be used where it may endanger life, financial stakes, or
28
+ cause discomfort and inconvenience to others.
29
+
30
+ ## Example basic usage
31
+
32
+ >>> from PyTado.interface import Tado
33
+ >>> t = Tado('my@username.com', 'mypassword')
34
+ >>> climate = t.get_climate(zone=1)
35
+
36
+ ## Contributing
37
+
38
+ We are very open to the community's contributions - be it a quick fix of a typo, or a completely new feature!
39
+
40
+ You don't need to be a Python expert to provide meaningful improvements. To learn how to get started, check out our
41
+ [Contributor Guidelines](https://github.com/wmalgadey/econnect-python/blob/main/CONTRIBUTING.md) first, and ask for help
42
+ in [GitHub Discussions](https://github.com/wmalgadey/PyTado/discussions) if you have questions.
43
+
44
+ ## Development
45
+
46
+ We welcome external contributions, even though the project was initially intended for personal use. If you think some
47
+ parts could be exposed with a more generic interface, please open a [GitHub issue](https://github.com/wmalgadey/PyTado/issues)
48
+ to discuss your suggestion.
49
+
50
+ ### Dev Environment
51
+
52
+ To contribute to this repository, you should first clone your fork and then setup your development environment. Clone
53
+ your repository as follows (replace yourusername with your GitHub account name):
54
+
55
+ ```bash
56
+ git clone https://github.com/yourusername/PyTado.git
57
+ cd PyTado
58
+ ```
59
+
60
+ Then, to create your development environment and install the project with its dependencies, execute the following
61
+ commands in your terminal:
62
+
63
+ ```bash
64
+ # Create and activate a new virtual environment
65
+ python3 -m venv venv
66
+ source venv/bin/activate
67
+
68
+ # Upgrade pip and install all projects and their dependencies
69
+ pip install --upgrade pip
70
+ pip install -e '.[all]'
71
+
72
+ # Install pre-commit hooks
73
+ pre-commit install
74
+ ```
75
+
76
+ ### Coding Guidelines
77
+
78
+ To maintain a consistent codebase, we utilize [black][1]. Consistency is crucial as it helps readability, reduces errors,
79
+ and facilitates collaboration among developers.
80
+
81
+ To ensure that every commit adheres to our coding standards, we've integrated [pre-commit hooks][2]. These hooks
82
+ automatically run `black` before each commit, ensuring that all code changes are automatically checked and formatted.
83
+
84
+ For details on how to set up your development environment to make use of these hooks, please refer to the
85
+ [Development][3] section of our documentation.
86
+
87
+ [1]: https://github.com/ambv/black
88
+ [2]: https://pre-commit.com/
89
+ [3]: https://github.com/wmalgadey/PyTado#development
90
+
91
+ ### Testing
92
+
93
+ Ensuring the robustness and reliability of our code is paramount. Therefore, all contributions must include at least one
94
+ test to verify the intended behavior.
95
+
96
+ To run tests locally, execute the test suite using `pytest` with the following command:
97
+
98
+ ```bash
99
+ pytest tests/ --cov --cov-branch -vv
100
+ ```
101
+
102
+ ---
103
+
104
+ A message from the original author:
105
+
106
+ > This software is at a purely experimental stage. If you're interested and can write Python, clone the Github repo,
107
+ > drop me a line, and get involved!
108
+ >
109
+ > Best wishes and a warm winter to all!
110
+ >
111
+ > Chris Jewell
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-tado"
7
- version = "0.18.4"
7
+ version = "0.18.5"
8
8
  description = "PyTado from chrism0dwk, modfied by w.malgadey, diplix, michaelarnauts, LenhartStephan, splifter, syssi, andersonshatch, Yippy, p0thi, Coffee2CodeNL, chiefdragon, FilBr, nikilase, albertomontesg, Moritz-Schmidt, palazzem"
9
9
  authors = [
10
10
  { name = "Chris Jewell", email = "chrism0dwk@gmail.com" },
@@ -31,7 +31,11 @@ classifiers = [
31
31
  GitHub = "https://github.com/wmalgadey/PyTado"
32
32
 
33
33
  [project.optional-dependencies]
34
- dev = ["black>=24.3", "pytype", "pylint", "types-requests", "responses", "coverage", "pytest", "pytest-cov"]
34
+ dev = ["black>=24.3", "pre-commit", "pytype", "pylint", "types-requests", "requests", "responses", "coverage", "pytest", "pytest-cov"]
35
+
36
+ all = [
37
+ "python-tado[dev]",
38
+ ]
35
39
 
36
40
  [project.scripts]
37
41
  pytado = "pytado.__main__:main"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-tado
3
- Version: 0.18.4
3
+ Version: 0.18.5
4
4
  Summary: PyTado from chrism0dwk, modfied by w.malgadey, diplix, michaelarnauts, LenhartStephan, splifter, syssi, andersonshatch, Yippy, p0thi, Coffee2CodeNL, chiefdragon, FilBr, nikilase, albertomontesg, Moritz-Schmidt, palazzem
5
5
  Author-email: Chris Jewell <chrism0dwk@gmail.com>, "w.malgadey" <w.malgadey@gmail.com>, FilBr <filippo.barba@protonmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -696,43 +696,126 @@ License-File: AUTHORS
696
696
  Requires-Dist: requests
697
697
  Provides-Extra: dev
698
698
  Requires-Dist: black>=24.3; extra == "dev"
699
+ Requires-Dist: pre-commit; extra == "dev"
699
700
  Requires-Dist: pytype; extra == "dev"
700
701
  Requires-Dist: pylint; extra == "dev"
701
702
  Requires-Dist: types-requests; extra == "dev"
703
+ Requires-Dist: requests; extra == "dev"
702
704
  Requires-Dist: responses; extra == "dev"
703
705
  Requires-Dist: coverage; extra == "dev"
704
706
  Requires-Dist: pytest; extra == "dev"
705
707
  Requires-Dist: pytest-cov; extra == "dev"
708
+ Provides-Extra: all
709
+ Requires-Dist: python-tado[dev]; extra == "all"
706
710
 
707
- PyTado -- Pythonize your central heating
708
- ========================================
711
+ # PyTado -- Pythonize your central heating
709
712
 
710
- Author: Chris Jewell <chrism0dwk@gmail.com>
711
- Modified: Wolfgang Malgadey <wolfgang@malgadey.de>
713
+ [![Linting and testing](https://github.com/wmalgadey/PyTado/actions/workflows/lint-and-test-matrix.yml/badge.svg)](https://github.com/wmalgadey/PyTado/actions/workflows/lint-and-test-matrix.yml)
714
+ [![Build and deploy to pypi](https://github.com/wmalgadey/PyTado/actions/workflows/publish-to-pypi.yml/badge.svg)](https://github.com/wmalgadey/PyTado/actions/workflows/publish-to-pypi.yml)
715
+ [![PyPI version](https://badge.fury.io/py/python-tado.svg)](https://badge.fury.io/py/python-tado)
716
+
717
+ PyTado is a Python module implementing an interface to the Tado web API. It allows a user to interact with their
718
+ Tado heating system for the purposes of monitoring or controlling their heating system, beyond what Tado themselves
719
+ currently offer.
720
+
721
+ It is hoped that this module might be used by those who wish to tweak their Tado systems, and further optimise their
722
+ heating setups.
723
+
724
+ ---
725
+
726
+ Original author: Chris Jewell <chrism0dwk@gmail.com>
712
727
 
713
728
  Licence: GPL v3
714
729
 
715
730
  Copyright: Chris Jewell 2016-2018
716
731
 
717
- PyTado is a Python module implementing an interface to the Tado web API. It allows a user to interact with their Tado heating system for the purposes of monitoring or controlling their heating system, beyond what Tado themselves currently offer.
732
+ ## Disclaimer
718
733
 
719
- It is hoped that this module might be used by those who wish to tweak their Tado systems, and further optimise their heating setups.
734
+ Besides owning a Tado system, I have no connection with the Tado company themselves. PyTado was created for my own use,
735
+ and for others who may wish to experiment with personal Internet of Things systems. I receive no help (financial or
736
+ otherwise) from Tado, and have no business interest with them. This software is provided without warranty, according to
737
+ the GNU Public Licence version 3, and should therefore not be used where it may endanger life, financial stakes, or
738
+ cause discomfort and inconvenience to others.
720
739
 
721
- Disclaimer
722
- ----------
723
- Besides owning a Tado system, I have no connection with the Tado company themselves. PyTado was created for my own use, and for others who may wish to experiment with personal Internet of Things systems. I receive no help (financial or otherwise) from Tado, and have no business interest with them. This software is provided without warranty, according to the GNU Public Licence version 3, and should therefore not be used where it may endanger life, financial stakes, or cause discomfort and inconvenience to others.
724
-
725
- Example basic usage
726
- -------------------
740
+ ## Example basic usage
727
741
 
728
742
  >>> from PyTado.interface import Tado
729
743
  >>> t = Tado('my@username.com', 'mypassword')
730
744
  >>> climate = t.get_climate(zone=1)
731
745
 
732
- Development
733
- -----------
734
- This software is at a purely experimental stage. If you're interested and can write Python, clone the Github repo, drop me a line, and get involved!
746
+ ## Contributing
747
+
748
+ We are very open to the community's contributions - be it a quick fix of a typo, or a completely new feature!
749
+
750
+ You don't need to be a Python expert to provide meaningful improvements. To learn how to get started, check out our
751
+ [Contributor Guidelines](https://github.com/wmalgadey/econnect-python/blob/main/CONTRIBUTING.md) first, and ask for help
752
+ in [GitHub Discussions](https://github.com/wmalgadey/PyTado/discussions) if you have questions.
753
+
754
+ ## Development
755
+
756
+ We welcome external contributions, even though the project was initially intended for personal use. If you think some
757
+ parts could be exposed with a more generic interface, please open a [GitHub issue](https://github.com/wmalgadey/PyTado/issues)
758
+ to discuss your suggestion.
759
+
760
+ ### Dev Environment
761
+
762
+ To contribute to this repository, you should first clone your fork and then setup your development environment. Clone
763
+ your repository as follows (replace yourusername with your GitHub account name):
764
+
765
+ ```bash
766
+ git clone https://github.com/yourusername/PyTado.git
767
+ cd PyTado
768
+ ```
769
+
770
+ Then, to create your development environment and install the project with its dependencies, execute the following
771
+ commands in your terminal:
772
+
773
+ ```bash
774
+ # Create and activate a new virtual environment
775
+ python3 -m venv venv
776
+ source venv/bin/activate
777
+
778
+ # Upgrade pip and install all projects and their dependencies
779
+ pip install --upgrade pip
780
+ pip install -e '.[all]'
781
+
782
+ # Install pre-commit hooks
783
+ pre-commit install
784
+ ```
785
+
786
+ ### Coding Guidelines
787
+
788
+ To maintain a consistent codebase, we utilize [black][1]. Consistency is crucial as it helps readability, reduces errors,
789
+ and facilitates collaboration among developers.
790
+
791
+ To ensure that every commit adheres to our coding standards, we've integrated [pre-commit hooks][2]. These hooks
792
+ automatically run `black` before each commit, ensuring that all code changes are automatically checked and formatted.
793
+
794
+ For details on how to set up your development environment to make use of these hooks, please refer to the
795
+ [Development][3] section of our documentation.
796
+
797
+ [1]: https://github.com/ambv/black
798
+ [2]: https://pre-commit.com/
799
+ [3]: https://github.com/wmalgadey/PyTado#development
800
+
801
+ ### Testing
802
+
803
+ Ensuring the robustness and reliability of our code is paramount. Therefore, all contributions must include at least one
804
+ test to verify the intended behavior.
805
+
806
+ To run tests locally, execute the test suite using `pytest` with the following command:
807
+
808
+ ```bash
809
+ pytest tests/ --cov --cov-branch -vv
810
+ ```
811
+
812
+ ---
735
813
 
736
- Best wishes and a warm winter to all!
814
+ A message from the original author:
737
815
 
738
- Chris Jewell
816
+ > This software is at a purely experimental stage. If you're interested and can write Python, clone the Github repo,
817
+ > drop me a line, and get involved!
818
+ >
819
+ > Best wishes and a warm winter to all!
820
+ >
821
+ > Chris Jewell
@@ -1,10 +1,15 @@
1
1
  requests
2
2
 
3
+ [all]
4
+ python-tado[dev]
5
+
3
6
  [dev]
4
7
  black>=24.3
8
+ pre-commit
5
9
  pytype
6
10
  pylint
7
11
  types-requests
12
+ requests
8
13
  responses
9
14
  coverage
10
15
  pytest
@@ -79,3 +79,16 @@ class TadoTestCase(unittest.TestCase):
79
79
  with mock.patch("PyTado.http.Http.request"):
80
80
  with self.assertRaises(Exception):
81
81
  self.tado_client.set_auto()
82
+
83
+ def test_get_running_times(self):
84
+ """Test the get_running_times method."""
85
+
86
+ with mock.patch(
87
+ "PyTado.http.Http.request",
88
+ return_value=json.loads(common.load_fixture("running_times.json")),
89
+ ):
90
+ running_times = self.tado_client.get_running_times("2023-08-01")
91
+
92
+ assert self.tado_client._http.request.called
93
+ assert running_times["lastUpdated"] == "2023-08-05T19:50:21Z"
94
+ assert running_times["runningTimes"][0]["zones"][0]["id"] == 1
@@ -1,39 +0,0 @@
1
- """
2
- PyTado interface abstraction to use app.tado.com or hops.tado.com
3
- """
4
-
5
- from PyTado.http import Http
6
- import PyTado.interface.api as API
7
-
8
-
9
- class Tado:
10
- """Interacts with a Tado thermostat via public API.
11
-
12
- Example usage: t = Tado('me@somewhere.com', 'mypasswd')
13
- t.get_climate(1) # Get climate, zone 1.
14
- """
15
-
16
- def __init__(
17
- self,
18
- username: str,
19
- password: str,
20
- http_session=None,
21
- debug: bool = False,
22
- ):
23
- """Class Constructor"""
24
-
25
- self._http = Http(
26
- username=username,
27
- password=password,
28
- http_session=http_session,
29
- debug=debug,
30
- )
31
-
32
- if self._http.is_x_line:
33
- self._api = API.TadoX(http=self._http, debug=debug)
34
- else:
35
- self._api = API.Tado(http=self._http, debug=debug)
36
-
37
- def __getattr__(self, name):
38
- """Delegiert den Aufruf von Methoden an die richtige API-Client-Implementierung."""
39
- return getattr(self._api, name)
@@ -1,32 +0,0 @@
1
- PyTado -- Pythonize your central heating
2
- ========================================
3
-
4
- Author: Chris Jewell <chrism0dwk@gmail.com>
5
- Modified: Wolfgang Malgadey <wolfgang@malgadey.de>
6
-
7
- Licence: GPL v3
8
-
9
- Copyright: Chris Jewell 2016-2018
10
-
11
- PyTado is a Python module implementing an interface to the Tado web API. It allows a user to interact with their Tado heating system for the purposes of monitoring or controlling their heating system, beyond what Tado themselves currently offer.
12
-
13
- It is hoped that this module might be used by those who wish to tweak their Tado systems, and further optimise their heating setups.
14
-
15
- Disclaimer
16
- ----------
17
- Besides owning a Tado system, I have no connection with the Tado company themselves. PyTado was created for my own use, and for others who may wish to experiment with personal Internet of Things systems. I receive no help (financial or otherwise) from Tado, and have no business interest with them. This software is provided without warranty, according to the GNU Public Licence version 3, and should therefore not be used where it may endanger life, financial stakes, or cause discomfort and inconvenience to others.
18
-
19
- Example basic usage
20
- -------------------
21
-
22
- >>> from PyTado.interface import Tado
23
- >>> t = Tado('my@username.com', 'mypassword')
24
- >>> climate = t.get_climate(zone=1)
25
-
26
- Development
27
- -----------
28
- This software is at a purely experimental stage. If you're interested and can write Python, clone the Github repo, drop me a line, and get involved!
29
-
30
- Best wishes and a warm winter to all!
31
-
32
- Chris Jewell
File without changes
File without changes
File without changes