mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Remove Trackr integration (API removed) (#55917)
* Delete Trackr component directory * Update .coverage.rc to remove Trackr * Update requirements_all.txt
This commit is contained in:
parent
f9e6e616f4
commit
efafe82799
@ -1095,7 +1095,6 @@ omit =
|
||||
homeassistant/components/tplink_lte/*
|
||||
homeassistant/components/traccar/device_tracker.py
|
||||
homeassistant/components/traccar/const.py
|
||||
homeassistant/components/trackr/device_tracker.py
|
||||
homeassistant/components/tractive/__init__.py
|
||||
homeassistant/components/tractive/device_tracker.py
|
||||
homeassistant/components/tractive/entity.py
|
||||
|
@ -1 +0,0 @@
|
||||
"""The trackr component."""
|
@ -1,73 +0,0 @@
|
||||
"""Support for the TrackR platform."""
|
||||
import logging
|
||||
|
||||
from pytrackr.api import trackrApiInterface
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.device_tracker import (
|
||||
PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA,
|
||||
)
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.event import track_utc_time_change
|
||||
from homeassistant.util import slugify
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
PLATFORM_SCHEMA = PARENT_PLATFORM_SCHEMA.extend(
|
||||
{vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_PASSWORD): cv.string}
|
||||
)
|
||||
|
||||
|
||||
def setup_scanner(hass, config: dict, see, discovery_info=None):
|
||||
"""Validate the configuration and return a TrackR scanner."""
|
||||
TrackRDeviceScanner(hass, config, see)
|
||||
return True
|
||||
|
||||
|
||||
class TrackRDeviceScanner:
|
||||
"""A class representing a TrackR device."""
|
||||
|
||||
def __init__(self, hass, config: dict, see) -> None:
|
||||
"""Initialize the TrackR device scanner."""
|
||||
|
||||
self.hass = hass
|
||||
self.api = trackrApiInterface(
|
||||
config.get(CONF_USERNAME), config.get(CONF_PASSWORD)
|
||||
)
|
||||
self.see = see
|
||||
self.devices = self.api.get_trackrs()
|
||||
self._update_info()
|
||||
|
||||
track_utc_time_change(self.hass, self._update_info, second=range(0, 60, 30))
|
||||
|
||||
def _update_info(self, now=None) -> None:
|
||||
"""Update the device info."""
|
||||
_LOGGER.debug("Updating devices %s", now)
|
||||
|
||||
# Update self.devices to collect new devices added
|
||||
# to the users account.
|
||||
self.devices = self.api.get_trackrs()
|
||||
|
||||
for trackr in self.devices:
|
||||
trackr.update_state()
|
||||
trackr_id = trackr.tracker_id()
|
||||
trackr_device_id = trackr.id()
|
||||
lost = trackr.lost()
|
||||
dev_id = slugify(trackr.name())
|
||||
if dev_id is None:
|
||||
dev_id = trackr_id
|
||||
location = trackr.last_known_location()
|
||||
lat = location["latitude"]
|
||||
lon = location["longitude"]
|
||||
|
||||
attrs = {
|
||||
"last_updated": trackr.last_updated(),
|
||||
"last_seen": trackr.last_time_seen(),
|
||||
"trackr_id": trackr_id,
|
||||
"id": trackr_device_id,
|
||||
"lost": lost,
|
||||
"battery_level": trackr.battery_level(),
|
||||
}
|
||||
|
||||
self.see(dev_id=dev_id, gps=(lat, lon), attributes=attrs)
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"domain": "trackr",
|
||||
"name": "TrackR",
|
||||
"documentation": "https://www.home-assistant.io/integrations/trackr",
|
||||
"requirements": ["pytrackr==0.0.5"],
|
||||
"codeowners": [],
|
||||
"iot_class": "cloud_polling"
|
||||
}
|
@ -1954,9 +1954,6 @@ pytouchline==0.7
|
||||
# homeassistant.components.traccar
|
||||
pytraccar==0.9.0
|
||||
|
||||
# homeassistant.components.trackr
|
||||
pytrackr==0.0.5
|
||||
|
||||
# homeassistant.components.tradfri
|
||||
pytradfri[async]==7.0.6
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user