Change to notification to use message even bus

This will allow any plugin to listen for a notification and respond accordingly.
This commit is contained in:
Luke Mullan
2017-06-27 14:52:01 +10:00
parent 00739ea38f
commit fc945f093c
2 changed files with 5 additions and 8 deletions
+1 -3
View File
@@ -224,9 +224,7 @@ class CraftBeerPi(ActorAPI, SensorAPI):
def notify(self, headline, message, type="success", timeout=5000):
self.beep()
msg = {"id": str(uuid.uuid1()), "type": type, "headline": headline, "message": message, "timeout": timeout}
if timeout is None:
self.cache["messages"].append(msg)
self.emit("NOTIFY", msg)
self.emit_message(msg)
def beep(self):
if self.buzzer is not None: