You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
440 B
16 lines
440 B
4 years ago
|
import requests as req # Used for HTTP requests for the Hue API
|
||
|
import json # API uses JSON
|
||
|
import config # Configuration for the controller
|
||
|
|
||
|
def genUrl(params: str):
|
||
|
return "https://" + config.address + "/api/" + config.username + params
|
||
|
|
||
|
def API_Request(ReqType: str, params: str):
|
||
|
apiReq = req.Request( ReqType, genUrl(params) )
|
||
|
|
||
|
apiReqPrep = apiReq.prepare()
|
||
|
apiSession = req.Session()
|
||
|
apiSession.send(apiReqPrep)
|
||
|
|
||
|
|