kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
167 stars 32 forks source link

Adding last log field to replace ifttt events #171

Closed carsso closed 6 months ago

carsso commented 6 months ago

Because nuki is dropping IFTTT support, it is now impossible to trigger actions based on open/unlock/lock events. This PR adds a new last_log field with the name of the thing or person that triggered the last action (with some extra attributes to get the action type and timestamp). Last unlock user field is kept unchanged to ensure retro-compatibility with old automations relying on that field.

carsso commented 6 months ago

Add exceptions handling, to put back old data when request to nuki web fails.

kvj commented 6 months ago

Looks good! Anything else would you like to add or should I merge the PR?

carsso commented 6 months ago

Maybe that's worth testing a few days how it reacts with the exception handling as I added it just minutes ago. But up to you, I am running that version on my HA and watching behaviour carefully.

kvj commented 6 months ago

ok, please let me know when you think it's ready to be merged

carsso commented 6 months ago

Seems to be working fine since two days. Feel ready to merge when you want to :) I'll continue watching carefully how it behaves and I'll suggest a patch if anything goes wrong.

carsso commented 6 months ago

@kvj Hello, it's been a week, everything still working as expected without any issue. You can merge when you want.

kvj commented 6 months ago

@carsso could you please check the latest main branch? if it works as expected I'll bump new release

carsso commented 6 months ago

@kvj Sure, will deploy main on my HA right away.

carsso commented 6 months ago

@kvj Seems to be working fine with main branch as of now.