mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
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 name
This commit is contained in:
parent
4cfd24a03a
commit
3ecf5596ff
3
homeassistant/components/demo/const.py
Normal file
3
homeassistant/components/demo/const.py
Normal file
@ -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."""
|
"""Demo platform for the Device tracker component."""
|
||||||
import random
|
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):
|
def setup_scanner(hass, config, see, discovery_info=None):
|
||||||
@ -36,6 +36,6 @@ def setup_scanner(hass, config, see, discovery_info=None):
|
|||||||
battery=53,
|
battery=53,
|
||||||
)
|
)
|
||||||
|
|
||||||
hass.services.register(DOMAIN, "demo", observe)
|
hass.services.register(DOMAIN, SERVICE_RANDOMIZE_DEVICE_TRACKER_DATA, observe)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
randomize_device_tracker_data:
|
||||||
|
description: Demonstrates using a device tracker to see where devices are located
|
Loading…
x
Reference in New Issue
Block a user