mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix the sabnzbd component api error (#17014)
* Bump pysabnzbd version number * Pass hass aiohttp session to pysabnzbd
This commit is contained in:
parent
29c2b2fe79
commit
993a02b8c4
@ -15,11 +15,12 @@ from homeassistant.const import (
|
|||||||
CONF_HOST, CONF_API_KEY, CONF_NAME, CONF_PORT, CONF_SENSORS, CONF_SSL)
|
CONF_HOST, CONF_API_KEY, CONF_NAME, CONF_PORT, CONF_SENSORS, CONF_SSL)
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.helpers import discovery
|
from homeassistant.helpers import discovery
|
||||||
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||||
from homeassistant.helpers.event import async_track_time_interval
|
from homeassistant.helpers.event import async_track_time_interval
|
||||||
from homeassistant.util.json import load_json, save_json
|
from homeassistant.util.json import load_json, save_json
|
||||||
|
|
||||||
REQUIREMENTS = ['pysabnzbd==1.0.1']
|
REQUIREMENTS = ['pysabnzbd==1.1.0']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -102,7 +103,8 @@ async def async_configure_sabnzbd(hass, config, use_ssl, name=DEFAULT_NAME,
|
|||||||
hass.config.path(CONFIG_FILE))
|
hass.config.path(CONFIG_FILE))
|
||||||
api_key = conf.get(base_url, {}).get(CONF_API_KEY, '')
|
api_key = conf.get(base_url, {}).get(CONF_API_KEY, '')
|
||||||
|
|
||||||
sab_api = SabnzbdApi(base_url, api_key)
|
sab_api = SabnzbdApi(base_url, api_key,
|
||||||
|
session=async_get_clientsession(hass))
|
||||||
if await async_check_sabnzbd(sab_api):
|
if await async_check_sabnzbd(sab_api):
|
||||||
async_setup_sabnzbd(hass, sab_api, config, name)
|
async_setup_sabnzbd(hass, sab_api, config, name)
|
||||||
else:
|
else:
|
||||||
@ -188,7 +190,8 @@ def async_request_configuration(hass, config, host):
|
|||||||
async def async_configuration_callback(data):
|
async def async_configuration_callback(data):
|
||||||
"""Handle configuration changes."""
|
"""Handle configuration changes."""
|
||||||
api_key = data.get(CONF_API_KEY)
|
api_key = data.get(CONF_API_KEY)
|
||||||
sab_api = SabnzbdApi(host, api_key)
|
sab_api = SabnzbdApi(host, api_key,
|
||||||
|
session=async_get_clientsession(hass))
|
||||||
if not await async_check_sabnzbd(sab_api):
|
if not await async_check_sabnzbd(sab_api):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -1057,7 +1057,7 @@ pyrainbird==0.1.6
|
|||||||
pyrecswitch==1.0.2
|
pyrecswitch==1.0.2
|
||||||
|
|
||||||
# homeassistant.components.sabnzbd
|
# homeassistant.components.sabnzbd
|
||||||
pysabnzbd==1.0.1
|
pysabnzbd==1.1.0
|
||||||
|
|
||||||
# homeassistant.components.climate.sensibo
|
# homeassistant.components.climate.sensibo
|
||||||
pysensibo==1.0.3
|
pysensibo==1.0.3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user