gdgib/span

Error during zeroconf setup (was: Testing authentication)

mbbush opened this issue · 8 comments

mbbush commented

I just got my span panel installed, and am testing out this integration. Since I work for Span, I have the ability to peek behind the curtain as far as source code and internal logs, so I'm hopeful I can help narrow down the cause of issues quickly.

At the moment I'm just getting started with this integration, and ran into this error:

Error setting up entry Span Panel nj-0000-abcdef for span_panel

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/span_panel/init.py", line 40, in async_setup_entry
access_token=config[CONF_ACCESS_TOKEN],
KeyError: 'access_token'

I'll take a look at the code and see what I can see.

mbbush commented

Ahh, the issue is that I configured my panel through the zeroconf flow, which is missing the code which sets the access token in the config.

mbbush commented

Once I set up my panel by manually entering the ip address, everything worked great as far as authentication. Well done!

gdgib commented

Thanks for the feedback on this one @mbbush !

Looks like I've got some debugging to do on the zeroconf flow, though. @etmelvin if you have any spare time, I think this is mostly your code at this point.

I’m traveling for the next couple days and won’t have access to my dev environments. I’ll definitely take a look at it when I get back!

gdgib commented

Good deal! FWIW, I also would love any notes you have about your dev env setup. I dislike my current half-baked setup for this stuff, and am looking to upgrade.

Do we know if there are any APIs available to us that resets the "remainingAuthUnlockButtonPresses" count? It's a little difficult to run tests without the ability to that. I've tried the logout feature from the webui but that doesn't seem to reset the count.

I have a change that should be ready to go, I'm waiting for my counter to reset and doing some more testing on it before the pull request

gdgib commented

Do we know if there are any APIs available to us that resets the "remainingAuthUnlockButtonPresses" count? It's a little difficult to run tests without the ability to that. I've tried the logout feature from the webui but that doesn't seem to reset the count.

IIRC the "login" button in the web UI displays the count while you're pressing it, which suggests there's an API in there somewhere.