Pull out event ids rather than full events for state

This commit is contained in:
Erik Johnston 2016-08-25 13:28:31 +01:00
parent eb6a7cf3f4
commit 17f4f14df7
4 changed files with 119 additions and 55 deletions

View file

@ -15,6 +15,14 @@
class EventContext(object):
def _set_current_state(self, current_state):
if current_state is not None:
self.current_state_ids = {k: e.event_id for k, e in current_state.items()}
else:
self.current_state_ids = None
self._current_state = current_state
current_state = property(lambda self: self._current_state, _set_current_state)
def __init__(self, current_state=None):
self.current_state = current_state