Added network status and renewable_sources
This commit is contained in:
parent
d0597d05a2
commit
7f8f3e19c7
26
script.py
26
script.py
@ -74,6 +74,30 @@ def get_ute_peak_info(device_id: str) -> dict:
|
||||
).json()["data"]
|
||||
|
||||
|
||||
def get_ute_network_status() -> dict:
|
||||
"""
|
||||
Get UTE network status from device id
|
||||
|
||||
Returns:
|
||||
dict: UTE network status
|
||||
"""
|
||||
|
||||
return make_request(
|
||||
"GET", "https://rocme.ute.com.uy/api/v1/info/network/status", authorization=authorization
|
||||
).json()["data"]["summary"]
|
||||
|
||||
|
||||
def get_ute_renewable_sources() -> str:
|
||||
"""
|
||||
Get UTE renewable sources
|
||||
|
||||
Returns:
|
||||
str: UTE renewable sources percentage
|
||||
"""
|
||||
|
||||
return make_request("GET", "https://rocme.ute.com.uy/api/v1/info/demand/global").json()["data"]["renewableSources"]
|
||||
|
||||
|
||||
def get_ute_historic_info(
|
||||
device_id: str,
|
||||
authorization: str,
|
||||
@ -201,6 +225,8 @@ if __name__ == "__main__":
|
||||
device_id = device_list[0]["accountServicePointId"]
|
||||
account_info = get_ute_account_info(device_id)
|
||||
peak_info = get_ute_peak_info(device_id)
|
||||
network_status = get_ute_network_status()
|
||||
renewable_sources = get_ute_renewable_sources()
|
||||
|
||||
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