Skip to content

Commit

Permalink
Update bluetooth_tracker service name and domain from 'device_tracker…
Browse files Browse the repository at this point in the history
…' to 'bluetooth_tracker' (home-assistant#29161)

* move service constants to const.py, update service domain, add service description

* update .coveragerc
  • Loading branch information
raman325 authored and balloob committed Nov 27, 2019
1 parent b6d94bc commit ceb1528
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ omit =
homeassistant/components/bloomsky/*
homeassistant/components/bluesound/*
homeassistant/components/bluetooth_le_tracker/device_tracker.py
homeassistant/components/bluetooth_tracker/device_tracker.py
homeassistant/components/bluetooth_tracker/*
homeassistant/components/bme280/sensor.py
homeassistant/components/bme680/sensor.py
homeassistant/components/bmw_connected_drive/*
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/bluetooth_tracker/const.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Constants for the Bluetooth Tracker component."""
DOMAIN = "bluetooth_tracker"
SERVICE_UPDATE = "update"
6 changes: 2 additions & 4 deletions homeassistant/components/bluetooth_tracker/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
CONF_SCAN_INTERVAL,
CONF_TRACK_NEW,
DEFAULT_TRACK_NEW,
DOMAIN,
SCAN_INTERVAL,
SOURCE_TYPE_BLUETOOTH,
)
Expand All @@ -25,6 +24,7 @@
from homeassistant.helpers.event import async_track_time_interval
from homeassistant.helpers.typing import HomeAssistantType

from .const import DOMAIN, SERVICE_UPDATE

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -184,8 +184,6 @@ async def handle_manual_update_bluetooth(call):
hass.async_create_task(update_bluetooth())
async_track_time_interval(hass, update_bluetooth, interval)

hass.services.async_register(
DOMAIN, "bluetooth_tracker_update", handle_manual_update_bluetooth
)
hass.services.async_register(DOMAIN, SERVICE_UPDATE, handle_manual_update_bluetooth)

return True
2 changes: 2 additions & 0 deletions homeassistant/components/bluetooth_tracker/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
update:
description: Trigger manual tracker update

0 comments on commit ceb1528

Please sign in to comment.