I am trying to call a function in a library written by someone else. Here is my code:
Thank you - Rowan
import growattServer
import datetime
import time
from datetime import date
import getpass
import json
import sys, getopt
import shutil
from enum import IntEnum
# set up variables
user_name = "rowan.bradley" # Server username
user_pass = "xxxxxxxxxxxxx" # server password
outFolder = "/growatt"
outPrefix = "growatt-"
outSuffix = ".json"
class Timespan(IntEnum):
hour = 0
day = 1
month = 2
api = growattServer.GrowattApi(False, "hue73jhns83je93jed723uj2")
login_response = api.login(user_name, user_pass)
today = date.fromtimestamp(time.time())
inverter_detail = api.inverter_detail('OOCTCHT07L', today)
print("inverter_detail = ", inverter_detail)This what happens when I run this:D:\XPS_8700 Extended Files\Users\RowanB\Documents\Inetpub\www.sylvesterbradley.org\public_html>python -O growatt3.py
Traceback (most recent call last):
File "D:\XPS_8700 Extended Files\Users\RowanB\Documents\Inetpub\www.sylvesterbradley.org\public_html\growatt3.py", line 26, in <module>
inverter_detail = api.inverter_detail('OOCTCHT07L', today)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: GrowattApi.inverter_detail() takes 2 positional arguments but 3 were given
D:\XPS_8700 Extended Files\Users\RowanB\Documents\Inetpub\www.sylvesterbradley.org\public_html>Why does it say that three arguments were given although it is clear from the call that there were only 2? How do I get this call to work?Thank you - Rowan
Larz60+ write Aug-06-2023, 12:19 AM:
removed sensitive information
removed sensitive information
