Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added possibility to connect to different tado accounts #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions PyTado/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ class Tado:
_debugCalls = False

# Instance-wide constant info
headers = {'Referer' : 'https://my.tado.com/'}
api2url = 'https://my.tado.com/api/v2/homes/'
mobi2url = 'https://my.tado.com/mobile/1.9/'
refresh_token = ''
refresh_at = datetime.datetime.now() + datetime.timedelta(minutes=5)

# 'Private' methods for use in class, Tado mobile API V1.9.
def _mobile_apiCall(self, cmd):
Expand All @@ -54,6 +51,7 @@ def _mobile_apiCall(self, cmd):

# 'Private' methods for use in class, Tado API V2.
def _apiCall(self, cmd, method="GET", data=None, plain=False):

# pylint: disable=C0103

self._refresh_token()
Expand Down Expand Up @@ -290,6 +288,9 @@ def setZoneOverlay(self, zone, overlayMode, setTemp=None, duration=None, deviceT
# Ctor
def __init__(self, username, password):
"""Performs login and save session cookie."""
self.headers = {'Referer' : 'https://my.tado.com/'}
self.refresh_token = ''
self.refresh_at = datetime.datetime.now() + datetime.timedelta(minutes=5)
# HTTPS Interface

# pylint: disable=C0103
Expand Down