Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Error after setting up untappd platform for sensor #31

Closed
arjanvroege opened this issue Dec 18, 2020 · 3 comments
Closed

Error after setting up untappd platform for sensor #31

arjanvroege opened this issue Dec 18, 2020 · 3 comments

Comments

@arjanvroege
Copy link

arjanvroege commented Dec 18, 2020

Version of Home Assistant and installation type

Version: 2020.12.1 (current) 0.118.5 (initial)
OS: Home Assistant OS 5.8

Version of the custom_component

Installed Version: 0.1.5 (Installed through HACS)

Describe the bug

After installing the sensor, adding the sensor YAML information to my config I restarted HA. After the restart the error below was logged. I searched for a possible solution and the suggestion was done to add some extra beers to my Untappd account (my existing Untappd account had already 100 beers checked in). I did some checkins in the past week and today the sensor was still not there. I restarted HA again but still ending up with the error below. In my dashboard on Untappd I can see that HA is executing requests so the sensor is able to contact, authenticate and use the API but fails on getting the last activities.

Another issue with the same message was already closed but since this issue is not resolved by checking in another beers I'm recreating this issue.

Debug log


Logger: homeassistant.components.sensor
Source: custom_components/untappd/sensor.py:89
Integration: Sensor (documentation, issues)
First occurred: 1:07:09 PM (1 occurrences)
Last logged: 1:07:09 PM

Error while setting up untappd platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/untappd/sensor.py", line 64, in setup_platform
    add_devices([UntappdCheckinSensor(username, api_id, api_secret)])
  File "/config/custom_components/untappd/sensor.py", line 85, in __init__
    self.update()
  File "/config/custom_components/untappd/sensor.py", line 89, in update
    result = self._untappd.get_last_activity(self._apiid,
  File "/usr/local/lib/python3.8/site-packages/pyuntappd/__init__.py", line 26, in get_last_activity
    activity = get_last_activity['response']['checkins']['items'][0]
KeyError: 'checkins'


@avdhil
Copy link

avdhil commented Jan 7, 2021

Same issue here

@arjanvroege
Copy link
Author

I've found the issue why I got this error. My Untappd account was private resulting in that the information cannot be retrieved through the API. I've changed my account to public and now the error is gone.

@avdhil
Copy link

avdhil commented Jan 7, 2021 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants