diff options
author | Roger Gonzalez <roger@rogs.me> | 2023-08-17 09:43:48 -0300 |
---|---|---|
committer | Roger Gonzalez <roger@rogs.me> | 2023-08-17 09:43:48 -0300 |
commit | d0597d05a2c4925d0ca8c3c6b956abd0ce1a7f35 (patch) | |
tree | 67468927bdf26490004adf0ac2a3d01a1d381f53 | |
parent | 5b8f75fb03aee5f6ba90b939fa1a93837509a547 (diff) |
Added function to get ute peak info
-rwxr-xr-x | script.py | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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) |