craftbeerpi4-pione/cbpi/controller/notification_controller.py
2021-02-10 22:11:35 +01:00

21 lines
440 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, key, message, type=None):
self.cbpi.ws.send(dict(topic="notifiaction", type=type, message=message))