From cf5f0a415ca2bc01237129a20ea5ddfe9d2cba5d Mon Sep 17 00:00:00 2001 From: Gleb Sinyavskiy Date: Tue, 26 Apr 2022 18:21:27 +0200 Subject: [PATCH] Add tractive client_id, update aiotractive (#70807) * Add client_id to Tractive * Update aiotractive --- homeassistant/components/tractive/__init__.py | 6 +++++- homeassistant/components/tractive/const.py | 4 ++++ homeassistant/components/tractive/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/tractive/__init__.py b/homeassistant/components/tractive/__init__.py index 99b47559d80..ff2ba9c34bf 100644 --- a/homeassistant/components/tractive/__init__.py +++ b/homeassistant/components/tractive/__init__.py @@ -30,6 +30,7 @@ from .const import ( ATTR_MINUTES_ACTIVE, ATTR_TRACKER_STATE, CLIENT, + CLIENT_ID, DOMAIN, RECONNECT_INTERVAL, SERVER_UNAVAILABLE, @@ -68,7 +69,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: hass.data.setdefault(DOMAIN, {}).setdefault(entry.entry_id, {}) client = aiotractive.Tractive( - data[CONF_EMAIL], data[CONF_PASSWORD], session=async_get_clientsession(hass) + data[CONF_EMAIL], + data[CONF_PASSWORD], + session=async_get_clientsession(hass), + client_id=CLIENT_ID, ) try: creds = await client.authenticate() diff --git a/homeassistant/components/tractive/const.py b/homeassistant/components/tractive/const.py index 0d7d62ccae7..a87e22c505d 100644 --- a/homeassistant/components/tractive/const.py +++ b/homeassistant/components/tractive/const.py @@ -13,6 +13,10 @@ ATTR_LIVE_TRACKING = "live_tracking" ATTR_MINUTES_ACTIVE = "minutes_active" ATTR_TRACKER_STATE = "tracker_state" +# This client ID was issued by Tractive specifically for Home Assistant. +# Please do not use it anywhere else. +CLIENT_ID = "625e5349c3c3b41c28a669f1" + CLIENT = "client" TRACKABLES = "trackables" diff --git a/homeassistant/components/tractive/manifest.json b/homeassistant/components/tractive/manifest.json index be005e3104a..a672c862959 100644 --- a/homeassistant/components/tractive/manifest.json +++ b/homeassistant/components/tractive/manifest.json @@ -3,7 +3,7 @@ "name": "Tractive", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/tractive", - "requirements": ["aiotractive==0.5.2"], + "requirements": ["aiotractive==0.5.4"], "codeowners": ["@Danielhiversen", "@zhulik", "@bieniu"], "iot_class": "cloud_push", "loggers": ["aiotractive"] diff --git a/requirements_all.txt b/requirements_all.txt index ea73075dde4..e4a983a0843 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -250,7 +250,7 @@ aioswitcher==2.0.6 aiosyncthing==0.5.1 # homeassistant.components.tractive -aiotractive==0.5.2 +aiotractive==0.5.4 # homeassistant.components.unifi aiounifi==31 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 13c9cf0d06e..60df27610e6 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -216,7 +216,7 @@ aioswitcher==2.0.6 aiosyncthing==0.5.1 # homeassistant.components.tractive -aiotractive==0.5.2 +aiotractive==0.5.4 # homeassistant.components.unifi aiounifi==31