Closed ryanbuckner closed 2 months ago
I've never intended this package for "standalone" usage. It was intended for use by a Home Assistant integration. If someone can use it for other purposes, and can figure out how to do so, by all means. I don't plan on improving the docs to that end.
Having said that, you can look here for how the HA integration I'm working on uses it:
Understood. Thanks for all you're doing.
Here's also a snippet from a test script I wrote:
import asyncio
from aiohttp import ClientSession, ClientTimeout
from life360 import Life360
USERNAME = "someone@someplace.com"
PASSWORD = "someones_password"
MAX_RETRIES = 2
VERBOSITY = 4
async def main():
session = ClientSession(timeout=ClientTimeout(15))
try:
api = Life360(session, MAX_RETRIES, verbosity=VERBOSITY)
authorization = await api.login_by_username(USERNAME, PASSWORD)
# Save authorization for future use if desired.
# It can be passed into the Life360 constructor and then login_by_username isn't necessary.
circles = api.get_circles()
# ...
finally:
await session.close()
asyncio.run(main())
This is working for me, thank you
Would you mind updating the read.me with a sample of how to use / test this new beta? I think logging in and printing a list of members would be sufficient.