mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
35 lines
711 B
Python
35 lines
711 B
Python
from ConfigParser import SafeConfigParser
|
|
|
|
from app.StateMachine import StateMachine
|
|
from app.EventBus import EventBus
|
|
from app.Logging import EventLogger
|
|
|
|
class Dependencies:
|
|
|
|
def __init__(self):
|
|
self.config = None
|
|
self.eventbus = None
|
|
self.statemachine = None
|
|
|
|
|
|
def get_config(self):
|
|
if self.config is None:
|
|
self.config = SafeConfigParser()
|
|
self.config.read("home-assistant.conf")
|
|
|
|
return self.config
|
|
|
|
def get_event_bus(self):
|
|
if self.eventbus is None:
|
|
self.eventbus = EventBus()
|
|
#EventLogger(self.eventbus)
|
|
|
|
return self.eventbus
|
|
|
|
def get_state_machine(self):
|
|
if self.statemachine is None:
|
|
self.statemachine = StateMachine(self.get_event_bus())
|
|
|
|
return self.statemachine
|
|
|