Added function to get ute peak info
This commit is contained in:
parent
5b8f75fb03
commit
d0597d05a2
19
script.py
19
script.py
@ -50,7 +50,7 @@ def get_ute_account_info(device_id: str) -> dict:
|
||||
device_id (str): UTE Device id
|
||||
|
||||
Returns:
|
||||
dict: UTE info
|
||||
dict: UTE account info
|
||||
"""
|
||||
|
||||
return make_request(
|
||||
@ -58,6 +58,22 @@ def get_ute_account_info(device_id: str) -> dict:
|
||||
).json()["data"]
|
||||
|
||||
|
||||
def get_ute_peak_info(device_id: str) -> dict:
|
||||
"""
|
||||
Get UTE peak info from device id
|
||||
|
||||
Args:
|
||||
device_id (str): UTE Device id
|
||||
|
||||
Returns:
|
||||
dict: UTE peak info
|
||||
"""
|
||||
|
||||
return make_request(
|
||||
"GET", f"https://rocme.ute.com.uy/api/v1/accounts/{device_id}/peak", authorization=authorization
|
||||
).json()["data"]
|
||||
|
||||
|
||||
def get_ute_historic_info(
|
||||
device_id: str,
|
||||
authorization: str,
|
||||
@ -184,6 +200,7 @@ if __name__ == "__main__":
|
||||
device_list = get_ute_device_list()
|
||||
device_id = device_list[0]["accountServicePointId"]
|
||||
account_info = get_ute_account_info(device_id)
|
||||
peak_info = get_ute_peak_info(device_id)
|
||||
|
||||
ute_historic_usage = get_ute_historic_info(device_id, authorization, average_price, date_start, date_end)
|
||||
ute_current_usage = get_current_usage_info(device_id, authorization)
|
||||
|
Reference in New Issue
Block a user