Skip to content

Commit 8125e3a

Browse files
committed
✨ Add possibility to use go.comwatt.com/api
1 parent 459c527 commit 8125e3a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

comwatt_client/client.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@ class ComwattClient:
1414
session (requests.Session): The session object for making HTTP requests.
1515
1616
"""
17-
def __init__(self):
18-
self.base_url = 'https://energy.comwatt.com/api'
17+
18+
API_ENDPOINTS = {
19+
'energy': 'https://energy.comwatt.com/api',
20+
'go': 'https://go.comwatt.com/api'
21+
}
22+
23+
def __init__(self, api = 'energy'):
24+
self.base_url = self.API_ENDPOINTS[api]
1925
self.session = requests.Session()
2026

2127
def authenticate(self, username, password):

0 commit comments

Comments
 (0)