mirror of
https://github.com/mlesniew/elicznik.git
synced 2025-12-21 13:23:06 +01:00
Remove meter_id parameter, it is not really needed
This commit is contained in:
@@ -33,10 +33,9 @@ class ELicznik:
|
|||||||
LOGIN_URL = "https://logowanie.tauron-dystrybucja.pl/login"
|
LOGIN_URL = "https://logowanie.tauron-dystrybucja.pl/login"
|
||||||
CHART_URL = "https://elicznik.tauron-dystrybucja.pl/index/charts"
|
CHART_URL = "https://elicznik.tauron-dystrybucja.pl/index/charts"
|
||||||
|
|
||||||
def __init__(self, username, password, meter_id):
|
def __init__(self, username, password):
|
||||||
self.username = username
|
self.username = username
|
||||||
self.password = password
|
self.password = password
|
||||||
self.meter_id = meter_id
|
|
||||||
|
|
||||||
def login(self):
|
def login(self):
|
||||||
self.session = Session()
|
self.session = Session()
|
||||||
@@ -56,7 +55,6 @@ class ELicznik:
|
|||||||
data={
|
data={
|
||||||
"dane[chartDay]": date.strftime("%d.%m.%Y"),
|
"dane[chartDay]": date.strftime("%d.%m.%Y"),
|
||||||
"dane[paramType]": "day",
|
"dane[paramType]": "day",
|
||||||
"dane[smartNr]": self.meter_id,
|
|
||||||
"dane[checkOZE]": "on",
|
"dane[checkOZE]": "on",
|
||||||
},
|
},
|
||||||
).json()
|
).json()
|
||||||
@@ -84,7 +82,6 @@ def main():
|
|||||||
default="table")
|
default="table")
|
||||||
parser.add_argument("username")
|
parser.add_argument("username")
|
||||||
parser.add_argument("password")
|
parser.add_argument("password")
|
||||||
parser.add_argument("meter_id")
|
|
||||||
parser.add_argument("date",
|
parser.add_argument("date",
|
||||||
nargs="?",
|
nargs="?",
|
||||||
type=lambda arg: datetime.datetime.strptime(arg, "%d.%m.%Y").date(),
|
type=lambda arg: datetime.datetime.strptime(arg, "%d.%m.%Y").date(),
|
||||||
@@ -92,7 +89,7 @@ def main():
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
elicznik = ELicznik(args.username, args.password, args.meter_id)
|
elicznik = ELicznik(args.username, args.password)
|
||||||
elicznik.login()
|
elicznik.login()
|
||||||
|
|
||||||
if args.format == "raw":
|
if args.format == "raw":
|
||||||
|
|||||||
Reference in New Issue
Block a user