update demo service domain and service description (#29164)
* update demo service domain and service description * move DOMAIN and service name to const.py * update per balloob's service name suggestion * update service name in services.yaml * update service name constant's namepull/29182/head
parent
4cfd24a03a
commit
3ecf5596ff
homeassistant/components/demo
|
@ -0,0 +1,3 @@
|
|||
"""Constants for the Demo component."""
|
||||
DOMAIN = "demo"
|
||||
SERVICE_RANDOMIZE_DEVICE_TRACKER_DATA = "randomize_device_tracker_data"
|
|
@ -1,7 +1,7 @@
|
|||
"""Demo platform for the Device tracker component."""
|
||||
import random
|
||||
|
||||
from homeassistant.components.device_tracker import DOMAIN
|
||||
from .const import DOMAIN, SERVICE_RANDOMIZE_DEVICE_TRACKER_DATA
|
||||
|
||||
|
||||
def setup_scanner(hass, config, see, discovery_info=None):
|
||||
|
@ -36,6 +36,6 @@ def setup_scanner(hass, config, see, discovery_info=None):
|
|||
battery=53,
|
||||
)
|
||||
|
||||
hass.services.register(DOMAIN, "demo", observe)
|
||||
hass.services.register(DOMAIN, SERVICE_RANDOMIZE_DEVICE_TRACKER_DATA, observe)
|
||||
|
||||
return True
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
randomize_device_tracker_data:
|
||||
description: Demonstrates using a device tracker to see where devices are located
|
Loading…
Reference in New Issue