alarms: integrate ooni alarms

This commit is contained in:
Iain Learmonth 2022-04-20 15:34:11 +01:00
parent 21a5d41e8c
commit 45a6d27c8b
4 changed files with 88 additions and 2 deletions

View file

@ -172,7 +172,7 @@ class Alarm(db.Model):
bridge = db.relationship("Bridge", back_populates="alarms")
def update_state(self, state: AlarmState, text: str):
if self.state != state:
if self.alarm_state != state:
self.state_changed = datetime.utcnow()
self.alarm_state = state
self.text = text