scudre / alarm-central-station-receiver

Python daemon for receiving events from a home alarm system via Contact ID protocol
Apache License 2.0
38 stars 10 forks source link

Fixed AlarmSystem exception when no GPIO pin set in config #47

Closed scudre closed 5 years ago

scudre commented 5 years ago

Exception was seen by @ljsanchez https://github.com/scudre/alarm-central-station-receiver/issues/41#issuecomment-433643564

When a GPIO pin isn't configured in the alarm config, AlarmSystem was not initializing the alarm status. When main.py attempted to check the alarm system's state it cause an exception. Instead we should always initialize the alarm stauts in AlarmSystem, even if a user is only going to monitor the system, and won't be arming/disarming (which is what the GPIO config is for.)