kirichkov / home_assistant-ble

Companion application for home-assistant, sending bluetooth low energy detection
21 stars 4 forks source link

Catches SIGINT and SIGTERM signals and exits gracefully #7

Closed kirichkov closed 7 years ago

kirichkov commented 7 years ago

Also all known devices are marked as away before exiting

kirichkov commented 7 years ago

@kamaradclimber can you check and merge this? I want to add extra options to demonize the process and to create pid file and possibly logging to file so this can be properly started via systemd/monit/etc.

kirichkov commented 7 years ago

My logic here is as follows - once the tracker is closed, the state should not be assumed as present. If the tracker is stopped - then there is no way to know whether a device is found or not. It's safer for hass to assume it away, then to be present.

As to writing it in a file - I think that's really overcomplicating it.

kirichkov commented 7 years ago

Thanks for merging!