natekspencer / pylitterbot

Python package for controlling a Whisker connected self-cleaning litter boxes and feeders
MIT License
87 stars 11 forks source link

issue running after setup #147

Closed chbeck2010 closed 1 year ago

chbeck2010 commented 1 year ago

Getting this error when trying to run your example.

Traceback (most recent call last): File "C:\Scripts\LitterRobotMonitorFarm\bin\get-litter-status.py", line 3, in from pylitterbot import Account File "C:\Users\Charles\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pylitterbot__init__.py", line 4, in from .account import Account File "C:\Users\Charles\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pylitterbot\account.py", line 145 if robot := self.get_robot(data.get(robot_cls._data_id)): ^ SyntaxError: invalid syntax

my python script at this point is literally the example (with updated username and password

`import asyncio

from pylitterbot import Account

Set email and password for initial authentication.

username = "Your username" password = "Your password"

async def main():

Create an account.

account = Account()

try:
    # Connect to the API and load robots.
    await account.connect(username=username, password=password, load_robots=True)

    # Print robots associated with account.
    print("Robots:")
    for robot in account.robots:
        print(robot)
finally:
    # Disconnect from the API.
    await account.disconnect()

if name == "main": asyncio.run(main())`

System info: WINDOWS 10 Python 3.7.4

natekspencer commented 1 year ago

It looks like you are using python 3.7 which is no longer supported.

chbeck2010 commented 1 year ago

Defiantly using python 3.7. what version of python do I need to move to? the latest is 3.11.3 but I thought all python 3 was pretty much the compatible so my bad.

Maybe it is documented somewhere but it may be worth adding suggested python version

natekspencer commented 1 year ago

3.7 stops receiving any support in just a couple of weeks so it was dropped a while ago from my test actions. Looks like I need to update the poetry file as it still lists 3.7 incorrectly. 3.8 - 3.11 are all tested though

chbeck2010 commented 1 year ago

Thanks for the help after updating to python 3.10.11. We are working again. Also thanks for your writing this. I know it takes a bit of time