Fix Skybell useragent (#38245)

This commit is contained in:
Mister Wil 2020-07-26 23:08:01 -07:00 committed by GitHub
parent 56186a3d75
commit 8fec0da5be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -5,7 +5,12 @@ from requests.exceptions import ConnectTimeout, HTTPError
from skybellpy import Skybell from skybellpy import Skybell
import voluptuous as vol 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 import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
@ -20,6 +25,8 @@ DOMAIN = "skybell"
DEFAULT_CACHEDB = "./skybell_cache.pickle" DEFAULT_CACHEDB = "./skybell_cache.pickle"
DEFAULT_ENTITY_NAMESPACE = "skybell" DEFAULT_ENTITY_NAMESPACE = "skybell"
AGENT_IDENTIFIER = f"HomeAssistant/{__version__}"
CONFIG_SCHEMA = vol.Schema( CONFIG_SCHEMA = vol.Schema(
{ {
DOMAIN: vol.Schema( DOMAIN: vol.Schema(
@ -42,7 +49,11 @@ def setup(hass, config):
try: try:
cache = hass.config.path(DEFAULT_CACHEDB) cache = hass.config.path(DEFAULT_CACHEDB)
skybell = Skybell( 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 hass.data[DOMAIN] = skybell

View File

@ -2,6 +2,6 @@
"domain": "skybell", "domain": "skybell",
"name": "SkyBell", "name": "SkyBell",
"documentation": "https://www.home-assistant.io/integrations/skybell", "documentation": "https://www.home-assistant.io/integrations/skybell",
"requirements": ["skybellpy==0.4.0"], "requirements": ["skybellpy==0.6.1"],
"codeowners": [] "codeowners": []
} }

View File

@ -1963,7 +1963,7 @@ simplisafe-python==9.2.1
sisyphus-control==2.2.1 sisyphus-control==2.2.1
# homeassistant.components.skybell # homeassistant.components.skybell
skybellpy==0.4.0 skybellpy==0.6.1
# homeassistant.components.slack # homeassistant.components.slack
slackclient==2.5.0 slackclient==2.5.0