Skip to content

Commit

Permalink
2.0.18 (#50)
Browse files Browse the repository at this point in the history
* Update const.py

* Update pyecotrend_ista.py

* Update ua.json

* Create helper_object.py

* Delete helper_object.py

* Update ua.json
  • Loading branch information
Ludy87 authored Jun 29, 2023
1 parent 5ef7d24 commit bcbe162
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/pyecotrend_ista/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "2.0.16"
VERSION = "2.0.18"
LOGIN_HEADER = {"Content-Type": "application/json"}
BASE_URL = "https://api.prod.eed.ista.com/"
ACCOUNT_URL = BASE_URL + "account"
Expand Down
7 changes: 6 additions & 1 deletion src/pyecotrend_ista/pyecotrend_ista.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,15 @@ async def consum_raw(self, select_year=None, select_month=None, filter_none=True
last_costs = {}
for costsByEnergyType in costs[0]["costsByEnergyType"]:
if (
costsByEnergyType["type"] is None
costsByEnergyType is None
or "type" not in costsByEnergyType
or costsByEnergyType["type"] is None
or "comparedCost" not in costsByEnergyType
or costsByEnergyType["comparedCost"] is None
or "smiley" not in costsByEnergyType["comparedCost"]
or costsByEnergyType["comparedCost"]["smiley"] is None
or "comparedPercentage" not in costsByEnergyType["comparedCost"]
or costsByEnergyType["comparedCost"]["comparedPercentage"] is None
):
continue

Expand Down
18 changes: 9 additions & 9 deletions src/pyecotrend_ista/ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,33 @@
{"useragent":"Mozilla\/5.0 (X11; Linux x86_64; rv:109.0) Gecko\/20100101 Firefox\/114.0","system":"Firefox Generic Linux"},
{"useragent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/605.1.15 (KHTML, like Gecko) Version\/16.5 Safari\/605.1.15","system":"Safari Generic macOS"},
{"useragent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/113.0.0.0 Safari\/537.36","system":"Chrome Generic Linux"},
{"useragent":"Mozilla\/5.0 (X11; Linux x86_64; rv:109.0) Gecko\/20100101 Firefox\/113.0","system":"Firefox Generic Linux"},
{"useragent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko\/20100101 Firefox\/114.0","system":"Firefox Generic macOS"},
{"useragent":"Mozilla\/5.0 (X11; Linux x86_64; rv:109.0) Gecko\/20100101 Firefox\/113.0","system":"Firefox Generic Linux"},
{"useragent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko\/20100101 Firefox\/113.0","system":"Firefox Generic macOS"},
{"useragent":"Mozilla\/5.0 (X11; Linux x86_64; rv:102.0) Gecko\/20100101 Firefox\/102.0","system":"Firefox 102.0 Linux"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/114.0.0.0 Safari\/537.36 Edg\/114.0.1823.43","system":"Edge Generic Win10"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/109.0.0.0 Safari\/537.36","system":"Chrome 109.0 Win10"},
{"useragent":"Mozilla\/5.0 (X11; Linux x86_64; rv:102.0) Gecko\/20100101 Firefox\/102.0","system":"Firefox 102.0 Linux"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; rv:114.0) Gecko\/20100101 Firefox\/114.0","system":"Firefox Generic Win10"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/109.0.0.0 Safari\/537.36","system":"Chrome 109.0 Win10"},
{"useragent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko\/20100101 Firefox\/114.0","system":"Firefox Generic Linux"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/113.0.0.0 Safari\/537.36 Edg\/113.0.1774.57","system":"Edge Generic Win10"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/113.0.0.0 Safari\/537.36 OPR\/99.0.0.0","system":"Opera Generic Win10"},
{"useragent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko\/20100101 Firefox\/113.0","system":"Firefox Generic Linux"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/113.0.0.0 Safari\/537.36 Edg\/113.0.1774.57","system":"Edge Generic Win10"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/114.0.0.0 Safari\/537.36 Edg\/114.0.1823.51","system":"Edge Generic Win10"},
{"useragent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko\/20100101 Firefox\/113.0","system":"Firefox Generic Linux"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; rv:113.0) Gecko\/20100101 Firefox\/113.0","system":"Firefox Generic Win10"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/112.0.0.0 Safari\/537.36","system":"Chrome 112.0 Win10"},
{"useragent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/605.1.15 (KHTML, like Gecko) Version\/16.4 Safari\/605.1.15","system":"Safari Generic macOS"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/114.0.0.0 Safari\/537.36 Edg\/114.0.1823.37","system":"Edge Generic Win10"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko\/20100101 Firefox\/102.0","system":"Firefox 102.0 Win10"},
{"useragent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/112.0.0.0 Safari\/537.36","system":"Chrome 112.0 macOS"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; rv:102.0) Gecko\/20100101 Firefox\/102.0","system":"Firefox 102.0 Win10"},
{"useragent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/605.1.15 (KHTML, like Gecko) Version\/16.3 Safari\/605.1.15","system":"Safari Generic macOS"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; rv:102.0) Gecko\/20100101 Firefox\/102.0","system":"Firefox 102.0 Win10"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/114.0.0.0 Safari\/537.36 Edg\/114.0.1823.58","system":"Edge Generic Win10"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/99.0.4844.51 Safari\/537.36","system":"Chrome 99.0 Win10"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/112.0.0.0 Safari\/537.36 OPR\/98.0.0.0","system":"Chrome 112.0 Win10"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/114.0.0.0 Safari\/537.36 Edg\/114.0.1823.41","system":"Edge Generic Win10"},
{"useragent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/605.1.15 (KHTML, like Gecko) Version\/16.5.1 Safari\/605.1.15","system":"Safari Generic macOS"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/114.0.0.0 Safari\/537.36 Edg\/114.0.1823.58","system":"Edge Generic Win10"},
{"useragent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/112.0.0.0 Safari\/537.36","system":"Chrome 112.0 Linux"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/112.0.0.0 Safari\/537.36 OPR\/98.0.0.0","system":"Chrome 112.0 Win10"},
{"useragent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/111.0.0.0 Safari\/537.36","system":"Chrome 111.0 macOS"},
{"useragent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/112.0.0.0 Safari\/537.36","system":"Chrome 112.0 Linux"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/111.0.0.0 Safari\/537.36","system":"Chrome 111.0 Win10"},
{"useragent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko\/20100101 Firefox\/112.0","system":"Firefox 112.0 Win10"},
{"useragent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/605.1.15 (KHTML, like Gecko) Version\/15.6.1 Safari\/605.1.15","system":"Safari 15.6.1 macOS"},
Expand Down

0 comments on commit bcbe162

Please sign in to comment.