custom-components / authenticated

A platform which allows you to get information about sucessfull logins to Home Assistant.
MIT License
82 stars 28 forks source link

Version 1.01 no sensor created #40

Closed DavidFW1960 closed 5 years ago

DavidFW1960 commented 5 years ago

Version of the custom_component

1.01 Describe the bug A clear and concise description of what the bug is. Same error... no sensor created log


Log Details (ERROR)
Sun Jul 07 2019 08:17:00 GMT+1000 (AEST)

authenticated: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 377, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/authenticated/sensor.py", line 144, in update
    ipaddress.lookup()
  File "/config/custom_components/authenticated/sensor.py", line 321, in lookup
    geo = get_geo_data(self.ip_address, self.provider)
  File "/config/custom_components/authenticated/sensor.py", line 222, in get_geo_data
    api = 'https://ipapi.co/' + ip_address + '/json'
TypeError: can only concatenate str (not "NoneType") to str
ludeeus commented 5 years ago

You must be joking... The ip it tries is None.. Check the YAML file, if you don't care about the values in it you can remove it to get it started

DavidFW1960 commented 5 years ago

I deleted .ip_authenticated.yaml and restarted home assistant. Same error

grantclem commented 5 years ago

I can confirm I am getting the same issue/error as David.

2019-07-07 08:13:56 ERROR (MainThread) [homeassistant.components.sensor] authenticated: Error on device update!
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 377, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/authenticated/sensor.py", line 144, in update
    ipaddress.lookup()
  File "/home/homeassistant/.homeassistant/custom_components/authenticated/sensor.py", line 321, in lookup
    geo = get_geo_data(self.ip_address, self.provider)
  File "/home/homeassistant/.homeassistant/custom_components/authenticated/sensor.py", line 222, in get_geo_data
    api = 'https://ipapi.co/' + ip_address + '/json'
TypeError: can only concatenate str (not "NoneType") to str
ludeeus commented 5 years ago

Okey... so it was not in the yaml file, you guys have entries in .storage/auth missing the IP :(

DavidFW1960 commented 5 years ago

That seems to have fixed it. Thanks @ludeeus