示例#1
0
    def _notify_listeners(self, devices):
        for device in devices:
            device.toggle_status()

            self.debug(device.to_json())
            broadcast_event(
                events.device_status_change(
                    device.to_json()))
示例#2
0
    def handle_event(self, event):
        if event.is_start_app():
            app = event.payload['name']

            broadcast_event(events.app_started(app))
            call(app)

            broadcast_event(events.app_stopped(app))

            while not self._event_queue.empty():
                self._event_queue.get()