MQTT convert to async (#6064)

* Migrate mqtt to async

* address paulus comment / convert it complet async

* adress paulus comment / remove future

* Automation triggers should be async

* Fix MQTT async calls

* Show that event helpers are callbacks

* Fix tests

* Lint
This commit is contained in:
Pascal Vizeli 2017-02-18 23:17:18 +01:00 committed by Paulus Schoutsen
parent fa2c1dafdf
commit e1cbd6b4c0
25 changed files with 356 additions and 231 deletions

View file

@ -86,7 +86,13 @@ def async_test_home_assistant(loop):
loop._thread_ident = threading.get_ident()
hass = ha.HomeAssistant(loop)
hass.async_track_tasks()
def async_add_job(target, *args):
if isinstance(target, MagicMock):
return
hass._async_add_job_tracking(target, *args)
hass.async_add_job = async_add_job
hass.config.location_name = 'test home'
hass.config.config_dir = get_test_config_dir()