From 8fec0da5be4ba2a786480cc19334e863d0d36494 Mon Sep 17 00:00:00 2001 From: Mister Wil <1091741+MisterWil@users.noreply.github.com> Date: Sun, 26 Jul 2020 23:08:01 -0700 Subject: [PATCH] Fix Skybell useragent (#38245) --- homeassistant/components/skybell/__init__.py | 15 +++++++++++++-- homeassistant/components/skybell/manifest.json | 2 +- requirements_all.txt | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/skybell/__init__.py b/homeassistant/components/skybell/__init__.py index a4e4263d360..9606d9bcf12 100644 --- a/homeassistant/components/skybell/__init__.py +++ b/homeassistant/components/skybell/__init__.py @@ -5,7 +5,12 @@ from requests.exceptions import ConnectTimeout, HTTPError from skybellpy import Skybell import voluptuous as vol -from homeassistant.const import ATTR_ATTRIBUTION, CONF_PASSWORD, CONF_USERNAME +from homeassistant.const import ( + ATTR_ATTRIBUTION, + CONF_PASSWORD, + CONF_USERNAME, + __version__, +) import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity @@ -20,6 +25,8 @@ DOMAIN = "skybell" DEFAULT_CACHEDB = "./skybell_cache.pickle" DEFAULT_ENTITY_NAMESPACE = "skybell" +AGENT_IDENTIFIER = f"HomeAssistant/{__version__}" + CONFIG_SCHEMA = vol.Schema( { DOMAIN: vol.Schema( @@ -42,7 +49,11 @@ def setup(hass, config): try: cache = hass.config.path(DEFAULT_CACHEDB) skybell = Skybell( - username=username, password=password, get_devices=True, cache_path=cache + username=username, + password=password, + get_devices=True, + cache_path=cache, + agent_identifier=AGENT_IDENTIFIER, ) hass.data[DOMAIN] = skybell diff --git a/homeassistant/components/skybell/manifest.json b/homeassistant/components/skybell/manifest.json index 9e0a0be8905..1b97b800956 100644 --- a/homeassistant/components/skybell/manifest.json +++ b/homeassistant/components/skybell/manifest.json @@ -2,6 +2,6 @@ "domain": "skybell", "name": "SkyBell", "documentation": "https://www.home-assistant.io/integrations/skybell", - "requirements": ["skybellpy==0.4.0"], + "requirements": ["skybellpy==0.6.1"], "codeowners": [] } diff --git a/requirements_all.txt b/requirements_all.txt index 8259f8f4937..a135e511937 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1963,7 +1963,7 @@ simplisafe-python==9.2.1 sisyphus-control==2.2.1 # homeassistant.components.skybell -skybellpy==0.4.0 +skybellpy==0.6.1 # homeassistant.components.slack slackclient==2.5.0