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

Previous Used is always blank #45

Closed DavidFW1960 closed 5 years ago

DavidFW1960 commented 5 years ago

Version of the custom_component

1.0.6 Sorry I keep breaking this @ludeeus Describe the bug A clear and concise description of what the bug is. All my IP addresses show no previously used time/date in yaml or in the sensor log

No log to add. Not generating any error just not showing a last used.
2001:4860:4801:8053::13:
  city: Ashburn
  country: United States
  hostname: rate-limited-proxy-2001-4860-4801-8053-0000-0000-0000-0013.google.com
  last_used_at: '2019-07-12T01:05:04.753358+00:00'
  prev_used_at: null
  region: Virginia
  user_id: bxxxxxxxxxxxxxxxxxxxxxxxxxx

172.30.32.2:
  city: null
  country: null
  hostname: hassio_supervisor.hassio
  last_used_at: '2019-07-09T18:32:08.615605+00:00'
  prev_used_at: null
  region: null
  user_id: 5xxxxxxxxxxxxxxxxxxxxxxx
ludeeus commented 5 years ago

Try the current master branch. in HACS click the burger icon, then update. When done, select "master" from the version list.

DavidFW1960 commented 5 years ago

OK Pulled Master (now HACS tells me there is an update available) But still not showing a previous time authenticated. Also the last auth seems to be out by a bit 2019-07-13T07:46:16.544574+00:00 Which was 2 minutes ago but it’s 6:56 here (PM) so 18:56 - 10 hours = 6:56 not 7:46....

Should I delete the .ip_authenticated.yaml file?

ludeeus commented 5 years ago

But still not showing a previous time authenticated.

It will not until you have a new time/date for the same IP.

As for the time, that is directly from the auth file probably shows in UTC

DavidFW1960 commented 5 years ago

Yes it is UTC (time zone +00:00) just doesn’t compute.

Ok so I’ll logout and see.. no different. I’ll see what happens..

DavidFW1960 commented 5 years ago

So I logged out; switched to 4G; logged in and the time and IP address was correct. Logged out; switched WiFi back on; logged in; Reauthenticated (trusted networks) and got the same old auth time instead of the new one....

ludeeus commented 5 years ago

That is how it works. It will not create a new entry/token, for a known IP unless it have to.

DavidFW1960 commented 5 years ago

Just got a persistent notification with correct auth time but tapping on sensor in Lovelace card reports wrong time. (And still no previous time)

DavidFW1960 commented 5 years ago

I'm actually wondering if the auth time showing in the sensor is actually the previous auth time and not the one just authenticated and it's not moving the former auth to previous.

DavidFW1960 commented 5 years ago

I still don't see any IP's showing a previous auth time? 71 IP's in .ip_authenticated.yaml (first line is

---

Is that correct?

ludeeus commented 5 years ago

Are you sure you are running the file from the latest master branch?

And yes https://github.com/custom-components/authenticated/issues/38

ludeeus commented 5 years ago

Found a time matching bug, try installing the latest from master now.

DavidFW1960 commented 5 years ago

Thanks @ludeeus... installed now. Just FWIW, installing Master then HACS always reports 1.0 is available... not a big thing and I don’t suppose there’s any way to stop that behaviour? (Only from the overview page)

DavidFW1960 commented 5 years ago

Immediately I’m getting a last authenticated time now.

ludeeus commented 5 years ago

installing Master then HACS always reports 1.0 is available...

that is expected, you should no use master at all, other than testing ;)

Immediately I’m getting a last authenticated time now.

NICE! will shortly push a release for it, thanks for testing.

DavidFW1960 commented 5 years ago

Ok great. Thanks Ludeeus