mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-25 16:38:36 +01:00
21 lines
435 B
Python
21 lines
435 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)
|
|
|
|
|
|
async def notify(self, message, type=None):
|
|
self.cbpi.ws.send(dict(topic="notifiaction", type=type, message=message))
|
|
|