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

Mobile App: Register devices into the registry (#21856)

* Register devices into the registry

* Switch to device ID instead of webhook ID

* Rearchitect mobile_app to support config entries

* Kill DATA_REGISTRATIONS by migrating registrations into config entries

* Fix tests

* Improve how we get the config_entry_id

* Remove single_instance_allowed

* Simplify setup_registration

* Move webhook registering functions into __init__.py since they are only ever used once

* Kill get_registration websocket command

* Support description_placeholders in async_abort

* Add link to mobile_app implementing apps in abort dialog

* Store config entry and device registry entry in hass.data instead of looking it up

* Add testing to ensure that the config entry is created at registration

* Fix busted async_abort test

* Remove unnecessary check for entry is None
This commit is contained in:
Robbie Trencheny
2019-03-14 12:57:50 -07:00
committed by GitHub
parent 62f12d242a
commit 3769f5893a
15 changed files with 254 additions and 212 deletions

View File

@@ -170,11 +170,13 @@ class FlowHandler:
}
@callback
def async_abort(self, *, reason: str) -> Dict:
def async_abort(self, *, reason: str,
description_placeholders: Optional[Dict] = None) -> Dict:
"""Abort the config flow."""
return {
'type': RESULT_TYPE_ABORT,
'flow_id': self.flow_id,
'handler': self.handler,
'reason': reason
'reason': reason,
'description_placeholders': description_placeholders,
}