Components+configuration now loaded dynamically
A major change to the bootstrapping of Home Assistant decoupling the knowledge in bootstrap for a more dynamic approach. This refactoring also prepares the code for different configuration backends and the loading components from different places.
This commit is contained in:
1 parent
cb33b3bf24
commit
997c2e8ef6
19 files changed
+473
-309
No files matched your search
@@ -26,12 +26,13 @@ from homeassistant.components import STATE_ON, STATE_OFF
|
||||
import homeassistant.util as util
|
||||
|
||||
DOMAIN = 'process'
|
||||
DEPENDENCIES = []
|
||||
ENTITY_ID_FORMAT = DOMAIN + '.{}'
|
||||
|
||||
PS_STRING = 'ps awx'
|
||||
|
||||
|
||||
def setup(hass, processes):
|
||||
def setup(hass, config):
|
||||
""" Sets up a check if specified processes are running.
|
||||
|
||||
processes: dict mapping entity id to substring to search for
|
||||
@@ -39,7 +40,7 @@ def setup(hass, processes):
|
||||
"""
|
||||
|
||||
entities = {ENTITY_ID_FORMAT.format(util.slugify(pname)): pstring
|
||||
for pname, pstring in processes.items()}
|
||||
for pname, pstring in config[DOMAIN].items()}
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def update_process_states(time):
|
||||
|
||||
Reference in new issue
Block a user