1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Person component: add storage and WS commands (#20852)

* Forbid duplicate IDs

* Allow loading persons from storage

* Convert to PersonManager

* Add storage support and WS commands to Person component

* Convert list command to differentiate types

* Allow loading person component without defining persons

* Fix cleanups after update/delete

* Address comments

* Start tracking when HA started
This commit is contained in:
Paulus Schoutsen
2019-02-09 10:41:40 -08:00
committed by GitHub
parent cfd1563bc8
commit 987b5cd905
4 changed files with 554 additions and 63 deletions

View File

@@ -31,6 +31,16 @@ class ActiveConnection:
return Context()
return Context(user_id=user.id)
@callback
def send_result(self, msg_id, result=None):
"""Send a result message."""
self.send_message(messages.result_message(msg_id, result))
@callback
def send_error(self, msg_id, code, message):
"""Send a error message."""
self.send_message(messages.error_message(msg_id, code, message))
@callback
def async_handle(self, msg):
"""Handle a single incoming message."""