Move group services into their own YAML (#9597)
* Move group services into their own YAML * Fix lint * Move persistent notification to packagepull/9646/head
parent
52671842d5
commit
f7609e9cb1
homeassistant/components
tests/components
persistent_notification
|
@ -269,7 +269,7 @@ def async_setup(hass, config):
|
||||||
|
|
||||||
hass.services.async_register(
|
hass.services.async_register(
|
||||||
DOMAIN, SERVICE_RELOAD, reload_service_handler,
|
DOMAIN, SERVICE_RELOAD, reload_service_handler,
|
||||||
descriptions[DOMAIN][SERVICE_RELOAD], schema=RELOAD_SERVICE_SCHEMA)
|
descriptions[SERVICE_RELOAD], schema=RELOAD_SERVICE_SCHEMA)
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def groups_service_handler(service):
|
def groups_service_handler(service):
|
||||||
|
@ -346,11 +346,11 @@ def async_setup(hass, config):
|
||||||
|
|
||||||
hass.services.async_register(
|
hass.services.async_register(
|
||||||
DOMAIN, SERVICE_SET, groups_service_handler,
|
DOMAIN, SERVICE_SET, groups_service_handler,
|
||||||
descriptions[DOMAIN][SERVICE_SET], schema=SET_SERVICE_SCHEMA)
|
descriptions[SERVICE_SET], schema=SET_SERVICE_SCHEMA)
|
||||||
|
|
||||||
hass.services.async_register(
|
hass.services.async_register(
|
||||||
DOMAIN, SERVICE_REMOVE, groups_service_handler,
|
DOMAIN, SERVICE_REMOVE, groups_service_handler,
|
||||||
descriptions[DOMAIN][SERVICE_REMOVE], schema=REMOVE_SERVICE_SCHEMA)
|
descriptions[SERVICE_REMOVE], schema=REMOVE_SERVICE_SCHEMA)
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def visibility_service_handler(service):
|
def visibility_service_handler(service):
|
||||||
|
@ -368,7 +368,7 @@ def async_setup(hass, config):
|
||||||
|
|
||||||
hass.services.async_register(
|
hass.services.async_register(
|
||||||
DOMAIN, SERVICE_SET_VISIBILITY, visibility_service_handler,
|
DOMAIN, SERVICE_SET_VISIBILITY, visibility_service_handler,
|
||||||
descriptions[DOMAIN][SERVICE_SET_VISIBILITY],
|
descriptions[SERVICE_SET_VISIBILITY],
|
||||||
schema=SET_VISIBILITY_SERVICE_SCHEMA)
|
schema=SET_VISIBILITY_SERVICE_SCHEMA)
|
||||||
|
|
||||||
return True
|
return True
|
|
@ -0,0 +1,59 @@
|
||||||
|
reload:
|
||||||
|
description: "Reload group configuration."
|
||||||
|
|
||||||
|
set_visibility:
|
||||||
|
description: Hide or show a group
|
||||||
|
|
||||||
|
fields:
|
||||||
|
entity_id:
|
||||||
|
description: Name(s) of entities to set value
|
||||||
|
example: 'group.travel'
|
||||||
|
|
||||||
|
visible:
|
||||||
|
description: True if group should be shown or False if it should be hidden.
|
||||||
|
example: True
|
||||||
|
|
||||||
|
set:
|
||||||
|
description: Create/Update a user group
|
||||||
|
|
||||||
|
fields:
|
||||||
|
object_id:
|
||||||
|
description: Group id and part of entity id
|
||||||
|
example: 'test_group'
|
||||||
|
|
||||||
|
name:
|
||||||
|
description: Name of group
|
||||||
|
example: 'My test group'
|
||||||
|
|
||||||
|
view:
|
||||||
|
description: Boolean for if the group is a view
|
||||||
|
example: True
|
||||||
|
|
||||||
|
icon:
|
||||||
|
description: Name of icon for the group
|
||||||
|
example: 'mdi:camera'
|
||||||
|
|
||||||
|
control:
|
||||||
|
description: Value for control the group control
|
||||||
|
example: 'hidden'
|
||||||
|
|
||||||
|
visible:
|
||||||
|
description: If the group is visible on UI
|
||||||
|
example: True
|
||||||
|
|
||||||
|
entities:
|
||||||
|
description: List of all members in the group. Not compatible with 'delta'
|
||||||
|
example: domain.entity_id1, domain.entity_id2
|
||||||
|
|
||||||
|
add_entities:
|
||||||
|
description: List of members they will change on group listening.
|
||||||
|
example: domain.entity_id1, domain.entity_id2
|
||||||
|
|
||||||
|
remove:
|
||||||
|
description: Remove a user group
|
||||||
|
|
||||||
|
fields:
|
||||||
|
object_id:
|
||||||
|
description: Group id and part of entity id
|
||||||
|
example: 'test_group'
|
||||||
|
|
|
@ -129,11 +129,11 @@ def async_setup(hass, config):
|
||||||
)
|
)
|
||||||
|
|
||||||
hass.services.async_register(DOMAIN, SERVICE_CREATE, create_service,
|
hass.services.async_register(DOMAIN, SERVICE_CREATE, create_service,
|
||||||
descriptions[DOMAIN][SERVICE_CREATE],
|
descriptions[SERVICE_CREATE],
|
||||||
SCHEMA_SERVICE_CREATE)
|
SCHEMA_SERVICE_CREATE)
|
||||||
|
|
||||||
hass.services.async_register(DOMAIN, SERVICE_DISMISS, dismiss_service,
|
hass.services.async_register(DOMAIN, SERVICE_DISMISS, dismiss_service,
|
||||||
descriptions[DOMAIN][SERVICE_DISMISS],
|
descriptions[SERVICE_DISMISS],
|
||||||
SCHEMA_SERVICE_DISMISS)
|
SCHEMA_SERVICE_DISMISS)
|
||||||
|
|
||||||
return True
|
return True
|
|
@ -0,0 +1,23 @@
|
||||||
|
create:
|
||||||
|
description: Show a notification in the frontend
|
||||||
|
|
||||||
|
fields:
|
||||||
|
message:
|
||||||
|
description: Message body of the notification. [Templates accepted]
|
||||||
|
example: Please check your configuration.yaml.
|
||||||
|
|
||||||
|
title:
|
||||||
|
description: Optional title for your notification. [Optional, Templates accepted]
|
||||||
|
example: Test notification
|
||||||
|
|
||||||
|
notification_id:
|
||||||
|
description: Target ID of the notification, will replace a notification with the same Id. [Optional]
|
||||||
|
example: 1234
|
||||||
|
|
||||||
|
dismiss:
|
||||||
|
description: Remove a notification from the frontend
|
||||||
|
|
||||||
|
fields:
|
||||||
|
notification_id:
|
||||||
|
description: Target ID of the notification, which should be removed. [Required]
|
||||||
|
example: 1234
|
|
@ -40,91 +40,6 @@ foursquare:
|
||||||
description: Vertical accuracy of the user's location, in meters.
|
description: Vertical accuracy of the user's location, in meters.
|
||||||
example: 1
|
example: 1
|
||||||
|
|
||||||
group:
|
|
||||||
reload:
|
|
||||||
description: "Reload group configuration."
|
|
||||||
|
|
||||||
set_visibility:
|
|
||||||
description: Hide or show a group
|
|
||||||
|
|
||||||
fields:
|
|
||||||
entity_id:
|
|
||||||
description: Name(s) of entities to set value
|
|
||||||
example: 'group.travel'
|
|
||||||
|
|
||||||
visible:
|
|
||||||
description: True if group should be shown or False if it should be hidden.
|
|
||||||
example: True
|
|
||||||
|
|
||||||
set:
|
|
||||||
description: Create/Update a user group
|
|
||||||
|
|
||||||
fields:
|
|
||||||
object_id:
|
|
||||||
description: Group id and part of entity id
|
|
||||||
example: 'test_group'
|
|
||||||
|
|
||||||
name:
|
|
||||||
description: Name of group
|
|
||||||
example: 'My test group'
|
|
||||||
|
|
||||||
view:
|
|
||||||
description: Boolean for if the group is a view
|
|
||||||
example: True
|
|
||||||
|
|
||||||
icon:
|
|
||||||
description: Name of icon for the group
|
|
||||||
example: 'mdi:camera'
|
|
||||||
|
|
||||||
control:
|
|
||||||
description: Value for control the group control
|
|
||||||
example: 'hidden'
|
|
||||||
|
|
||||||
visible:
|
|
||||||
description: If the group is visible on UI
|
|
||||||
example: True
|
|
||||||
|
|
||||||
entities:
|
|
||||||
description: List of all members in the group. Not compatible with 'delta'
|
|
||||||
example: domain.entity_id1, domain.entity_id2
|
|
||||||
|
|
||||||
add_entities:
|
|
||||||
description: List of members they will change on group listening.
|
|
||||||
example: domain.entity_id1, domain.entity_id2
|
|
||||||
|
|
||||||
remove:
|
|
||||||
description: Remove a user group
|
|
||||||
|
|
||||||
fields:
|
|
||||||
object_id:
|
|
||||||
description: Group id and part of entity id
|
|
||||||
example: 'test_group'
|
|
||||||
|
|
||||||
persistent_notification:
|
|
||||||
create:
|
|
||||||
description: Show a notification in the frontend
|
|
||||||
|
|
||||||
fields:
|
|
||||||
message:
|
|
||||||
description: Message body of the notification. [Templates accepted]
|
|
||||||
example: Please check your configuration.yaml.
|
|
||||||
|
|
||||||
title:
|
|
||||||
description: Optional title for your notification. [Optional, Templates accepted]
|
|
||||||
example: Test notification
|
|
||||||
|
|
||||||
notification_id:
|
|
||||||
description: Target ID of the notification, will replace a notification with the same Id. [Optional]
|
|
||||||
example: 1234
|
|
||||||
|
|
||||||
dismiss:
|
|
||||||
description: Remove a notification from the frontend
|
|
||||||
|
|
||||||
fields:
|
|
||||||
notification_id:
|
|
||||||
description: Target ID of the notification, which should be removed. [Required]
|
|
||||||
example: 1234
|
|
||||||
|
|
||||||
homematic:
|
homematic:
|
||||||
virtualkey:
|
virtualkey:
|
||||||
description: Press a virtual key from CCU/Homegear or simulate keypress
|
description: Press a virtual key from CCU/Homegear or simulate keypress
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
"""Tests for the group component."""
|
|
@ -0,0 +1 @@
|
||||||
|
"""Test the persistent notification component."""
|
Loading…
Reference in New Issue