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

User as state of last successful authentication? #87

Open jatgm1 opened 2 years ago

jatgm1 commented 2 years ago

Version of the custom_component

Describe the bug A clear and concise description of what the bug is. It seems that this still sends fully functional persistent notifications with the current version of home assistant, and works fine except that the state of sensor.last_sucessful_authentification is just an ip address, can that be changed to a user? Or have the user added as an attribute? It works fine in the persistent notifications. And despite being depreciated is still functional. And is a really useful tool in general. Like super useful. log

Add your logs here.
Electronlibre2012 commented 2 years ago

yes, i am agree, dont understand why it is depreciated?

jatgm1 commented 2 years ago

If someone could just add user as an attribute that would fix everything. Idk how it works so idk what to do but that would be frekin awesome.

Edit Its now telling me to remove the repository? That stinks it's super useful if it just had the user as an attribute.

DavidFW1960 commented 2 years ago

Does the yaml log file of auth contain user info? Maybe we can parse that with a template. I dont understand why its deprecated either as there is no alternate we can use

jatgm1 commented 2 years ago

I mean the persistent notifications do so I would imagine it has to

jatgm1 commented 2 years ago

Just checked, yep it has it. At the end of the entry for each login it's got the user right there. So how would one write something to parse it for the user and make a separate entity to display the user of the last entity? It's called ".ip_authenticated.yaml" the first entry is the ip address and the next lines are two spaces in and the last, also two spaces down is the user

DavidFW1960 commented 2 years ago

Ok ao all the other data is included as attributes including the username as you can see in dev-tools so you can definitely extract and display that easily

DavidFW1960 commented 2 years ago

image