Persist updates.State upon disconnection

This commit is contained in:
Lonami Exo
2018-04-25 13:37:29 +02:00
parent e2a0de1913
commit 2a00bcaa12
5 changed files with 49 additions and 0 deletions

View File

@@ -67,6 +67,25 @@ class Session(ABC):
"""
raise NotImplementedError
@abstractmethod
def get_update_state(self, entity_id):
"""
Returns the ``UpdateState`` associated with the given `entity_id`.
If the `entity_id` is 0, it should return the ``UpdateState`` for
no specific channel (the "general" state). If no state is known
it should ``return None``.
"""
raise NotImplementedError
@abstractmethod
def set_update_state(self, entity_id, state):
"""
Sets the given ``UpdateState`` for the specified `entity_id`, which
should be 0 if the ``UpdateState`` is the "general" state (and not
for any specific channel).
"""
raise NotImplementedError
@abstractmethod
def close(self):
"""