Reorg: Merged observers, actors and HTTPInterface into components
This commit is contained in:
1 parent
c5f5dcbce2
commit
dd271febae
19 files changed
+795
-659
No files matched your search
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
homeassistant.components.general
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This component contains a service to shut down all devices.
|
||||
"""
|
||||
|
||||
import homeassistant as ha
|
||||
from . import chromecast, light
|
||||
|
||||
SERVICE_SHUTDOWN_DEVICES = "shutdown_devices"
|
||||
|
||||
|
||||
def shutdown_devices(bus, statemachine):
|
||||
""" Tries to shutdown all devices that are currently on. """
|
||||
chromecast.turn_off(statemachine)
|
||||
light.turn_off(bus)
|
||||
|
||||
|
||||
def setup(bus, statemachine):
|
||||
""" Setup services related to homeassistant. """
|
||||
|
||||
bus.register_service(ha.DOMAIN_HOMEASSISTANT, SERVICE_SHUTDOWN_DEVICES,
|
||||
lambda service: shutdown_devices(bus, statemachine))
|
||||
|
||||
return True
|
||||
Reference in new issue
Block a user