mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-29 02:04:15 +01:00
24 lines
491 B
Python
24 lines
491 B
Python
|
from core.api.decorator import on_event
|
||
|
|
||
|
|
||
|
class NotificationController():
|
||
|
'''
|
||
|
This the notification controller
|
||
|
|
||
|
|
||
|
'''
|
||
|
|
||
|
def __init__(self, cbpi):
|
||
|
'''
|
||
|
Initializer
|
||
|
|
||
|
:param cbpi: the cbpi server object
|
||
|
'''
|
||
|
self.cbpi = cbpi
|
||
|
self.cbpi.register(self)
|
||
|
|
||
|
@on_event(topic="notification/#")
|
||
|
def on_event(self, key, message, type, **kwargs):
|
||
|
|
||
|
print("EVENT RECHEICVED", kwargs)
|
||
|
self.cbpi.ws.send("YES")
|