Skip to content

Commit 943f997

Browse files
authored
Fix per changes in device_tracker component (pnbruckner#15)
1 parent e8d871d commit 943f997

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ If a watched device has a `battery` or `battery_level` attribute, that will be u
7373

7474
The watched devices, and the composite device, should all have `track` set to `true`.
7575

76-
It's recommended, as well, to set `hide_if_away` to `true` for the watched devices (but leave it set to `false` for the composite device.) This way the map will only show the composite device (of course when it is out of the home zone.) **NOTE:** The downside to hiding the watched devices, though, is that their history (other than when they're home) will not get recorded and hence will not be available in history views. (In history views they will appear to always be home.) Also they are hidden *everywhere* in the UI when not home (not just the map.)
77-
78-
Lastly, it is also recommended to _not_ use the native merge feature of the device tracker component (i.e., do not add the MAC address from network-based trackers to a GPS-based tracker. See more details in the [Device Tracker doc page](https://www.home-assistant.io/components/device_tracker/#using-gps-device-trackers-with-local-network-device-trackers).)
76+
It is recommended to _not_ use the native merge feature of the device tracker component (i.e., do not add the MAC address from network-based trackers to a GPS-based tracker. See more details in the [Device Tracker doc page](https://www.home-assistant.io/components/device_tracker/#using-gps-device-trackers-with-local-network-device-trackers).)
7977

8078
## Attributes
8179

custom_components/composite/device_tracker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
ATTR_BATTERY, ATTR_SOURCE_TYPE, PLATFORM_SCHEMA,
1111
SOURCE_TYPE_BLUETOOTH, SOURCE_TYPE_BLUETOOTH_LE, SOURCE_TYPE_GPS,
1212
SOURCE_TYPE_ROUTER)
13-
from homeassistant.components.device_tracker.const import ENTITY_ID_FORMAT
1413
from homeassistant.components.zone import ENTITY_ID_HOME
1514
from homeassistant.components.zone import async_active_zone
1615
from homeassistant.const import (
@@ -87,7 +86,7 @@ def __init__(self, hass, config, see):
8786
SOURCE_TYPE: None,
8887
DATA: None}
8988
self._dev_id = config[CONF_NAME]
90-
self._entity_id = ENTITY_ID_FORMAT.format(self._dev_id)
89+
self._entity_id = f"device_tracker.{self._dev_id}"
9190
self._time_as = config[CONF_TIME_AS]
9291
if self._time_as in [TZ_DEVICE_UTC, TZ_DEVICE_LOCAL]:
9392
self._tf = hass.data[DOMAIN]

0 commit comments

Comments
 (0)