craftbeerpi4-pione/core/controller/notification_controller.py

21 lines
446 B
Python
Raw Normal View History

2018-11-16 20:35:59 +01:00
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)
2018-12-10 22:13:28 +01:00
@on_event(topic="notification/#")
2018-12-13 21:45:33 +01:00
async def _on_event(self, key, message, type, **kwargs):
2018-11-16 20:35:59 +01:00
self.cbpi.ws.send("YES")