craftbeerpi4-pione/core/controller/notification_controller.py
2019-01-02 21:20:44 +01:00

21 lines
436 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, **kwargs):
self.cbpi.ws.send("YES")