Cannot login after entering code that was sent to my phone #1003
Replies: 5 comments 1 reply
-
the way i got the repo was cloning it. Could that be an issue since I took the developer version? |
Beta Was this translation helpful? Give feedback.
-
@albertpierce you don't have to worry about that error, it's just an async thing. There's a way to properly handle it, but honestly I forget what it is and I run scripts that produce that error constantly without issue. Not the answer you were hoping for, I'm sure, sorry! |
Beta Was this translation helpful? Give feedback.
-
Hi @fronzbot thank you for responding to my message. I am trying to go through the process of logging in and getting data from my camera, but that issue blocks me from starting the process. What ways do you use to get around this issue? @rsalesas I have not been able to get passed that spot of the code even though i provided my login account credentials. I have had to work on other projects so I could not come back to this at the moment. Any luck with you? |
Beta Was this translation helpful? Give feedback.
-
It's not entirely clear what you're trying to do, but if you get the unclosed connected error that's not blocking you- your code has finished executing. So your script you're running has exited. Here is example code to initialize blink and print out camera information. Anything you want to do has to be in that main loop section. Note that I am using a credential file here, but normal username/password combo (with entering an auth key) should work as well. import asyncio
from aiohttp import ClientSession
from blinkpy.blinkpy import Blink
from blinkpy.auth import Auth
from blinkpy.helpers.util import json_load
async def blink_start(session, credfile):
blink = Blink(session=session)
blink.auth = Auth(await json_load(credfile), session=session)
await blink.start()
status = await blink.get_status()
print(status)
return blink
async def main(loop):
async with ClientSession(loop=loop) as session:
blink = await blink_start(session, "/home/kevin/.blink.auth")
print(blink.cameras)
loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop)) |
Beta Was this translation helpful? Give feedback.
-
Unable to access https://rest-u015.immedia-semi.com/api/v3/accounts/440736/homescreen after token refresh.
Enter code sent to XXXXX: somecode
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x1028006e0>
Unclosed connector
I am trying to login to my account here to test some functionality out. I was able to retrieve the code that was sent to my phone then i get this error message. Is this due because I tried multiple times to login and my prior connections were not closed?
I am using the code that is in the README file to see if I can login. Any suggestions or ideas I should do to get around this?
import asyncio
from aiohttp import ClientSession
from blinkpy.blinkpy import Blink
async def start():
blink = Blink(session=ClientSession())
await blink.start()
return blink
blink = asyncio.run(start())
Beta Was this translation helpful? Give feedback.
All reactions