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

Multiple notifications from the same ip address in latest version #41

Closed DavidFW1960 closed 5 years ago

DavidFW1960 commented 5 years ago

Version of the custom_component

Latest Describe the bug A clear and concise description of what the bug is. I am getting 10’s of Persistent Notifications since the latest version of Authenticated. I deleted the .ip_authenticated.yaml as well but I keep getting notifications - didn’t happen before. log

KeyError: 'ip-address'
2019-07-07 20:02:53 WARNING (SyncWorker_6) [TransportNSW.transportnsw] No stop events for this query
2019-07-07 20:03:54 WARNING (SyncWorker_4) [TransportNSW.transportnsw] No stop events for this query
2019-07-07 20:03:54 WARNING (SyncWorker_5) [TransportNSW.transportnsw] No stop events for this query
2019-07-07 20:03:54 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.last_successful_authentication fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
    await self.async_device_update()
  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 156, in update
    self.last_ip = self.hass.data[PLATFORM_NAME][tokens[0]["last_used_ip"]]
KeyError: 'ip-address'
2019-07-07 20:04:55 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.last_successful_authentication fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
    await self.async_device_update()
  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 156, in update
    self.last_ip = self.hass.data[PLATFORM_NAME][tokens[0]["last_used_ip"]]
KeyError: 'ip-address'
ludeeus commented 5 years ago

@DavidFW1960 Do you know if this supports IPv6 addresses?

DavidFW1960 commented 5 years ago

Well it has before now... I do use caddy and the sensor has been happily showing my IPv6 address or Google Address (if it was triggered by Google Assistant) or an IPv4 Docker address... it was working perfectly till now.