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
@@ -9,6 +9,7 @@ import logging
|
||||
import homeassistant.components as components
|
||||
|
||||
DOMAIN = "keyboard"
|
||||
DEPENDENCIES = []
|
||||
|
||||
|
||||
def volume_up(hass):
|
||||
@@ -41,13 +42,14 @@ def media_prev_track(hass):
|
||||
hass.call_service(DOMAIN, components.SERVICE_MEDIA_PREV_TRACK)
|
||||
|
||||
|
||||
def setup(hass):
|
||||
# pylint: disable=unused-argument
|
||||
def setup(hass, config):
|
||||
""" Listen for keyboard events. """
|
||||
try:
|
||||
import pykeyboard
|
||||
except ImportError:
|
||||
logging.getLogger(__name__).exception(
|
||||
"MediaButtons: Error while importing dependency PyUserInput.")
|
||||
"Error while importing dependency PyUserInput.")
|
||||
|
||||
return False
|
||||
|
||||
|
||||
Reference in new issue
Block a user