Enable proxying of Triggerless messages in TFWServer

This commit is contained in:
Kristóf Tóth 2018-02-23 15:14:23 +01:00
parent cf4a5bc09d
commit 76456b36de

View File

@ -24,11 +24,13 @@ class TFWServer:
return self._fsm
def make_response(self, message):
trigger = message.get('trigger', '')
try: self.fsm.trigger(trigger, message=message)
except AttributeError: log.debug('FSM failed to execute nonexistent trigger: "{}"'.format(trigger))
return message
def proxy_filter(self, message):
try: return self.fsm.trigger(message['key'], message=message)
except AttributeError: return False
return True
def listen(self, port):
self.application.listen(port)