-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathurls.py
More file actions
40 lines (32 loc) · 889 Bytes
/
urls.py
File metadata and controls
40 lines (32 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import re
try:
# Python 3
from urllib.parse import quote_plus
except ImportError:
# Python 2
from urllib import quote_plus
BASE_URL = 'https://accsmart.panasonic.com'
def login():
return '{base_url}/auth/login'.format(
base_url=BASE_URL)
def get_groups():
return '{base_url}/device/group'.format(
base_url=BASE_URL)
def status(guid):
return '{base_url}/deviceStatus/{guid}'.format(
base_url=BASE_URL,
guid=re.sub(r'(?i)\%2f', 'f', quote_plus(guid))
)
def statusCache(guid):
return '{base_url}/deviceStatus/now/{guid}'.format(
base_url=BASE_URL,
guid=re.sub(r'(?i)\%2f', 'f', quote_plus(guid))
)
def control():
return '{base_url}/deviceStatus/control'.format(
base_url=BASE_URL
)
def history():
return '{base_url}/deviceHistoryData'.format(
base_url=BASE_URL,
)