mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-09 17:07:43 +01:00
22 lines
454 B
Python
22 lines
454 B
Python
from cbpi.api import *
|
|
|
|
|
|
class NotificationController(object):
|
|
'''
|
|
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/#")
|
|
async def _on_event(self, key, message, type=None, **kwargs):
|
|
self.cbpi.ws.send(dict(key=message))
|
|
|