Load mqtt_eventstream before any other component. (#5629)

This ensures that initial state changes for components are broadcasted on the MQTT bus.
pull/5682/head
Johan Bloemberg 2017-01-31 17:02:28 +01:00 committed by Paulus Schoutsen
parent b080ae154c
commit 9925b2a8e0
1 changed files with 4 additions and 1 deletions

View File

@ -177,6 +177,8 @@ def load_order_components(components: Sequence[str]) -> OrderedSet:
- Will ensure that all components that do not directly depend on
the group component will be loaded before the group component.
- returns an OrderedSet load order.
- Makes sure MQTT eventstream is available for publish before
components start updating states.
Async friendly.
"""
@ -193,7 +195,8 @@ def load_order_components(components: Sequence[str]) -> OrderedSet:
load_order.update(comp_load_order)
# Push some to first place in load order
for comp in ('logger', 'recorder', 'introduction'):
for comp in ('mqtt_eventstream', 'mqtt', 'logger',
'recorder', 'introduction'):
if comp in load_order:
load_order.promote(comp)