Rename device to api in Axis integration (#113965)

This commit is contained in:
Robert Svensson 2024-03-22 18:07:33 +01:00 committed by GitHub
parent c6f2ff8e88
commit 6800034d5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,7 +28,7 @@ async def get_axis_api(
"""Create a Axis device API."""
session = get_async_client(hass, verify_ssl=False)
device = axis.AxisDevice(
api = axis.AxisDevice(
Configuration(
session,
config[CONF_HOST],
@ -41,9 +41,7 @@ async def get_axis_api(
try:
async with timeout(30):
await device.vapix.initialize()
return device
await api.vapix.initialize()
except axis.Unauthorized as err:
LOGGER.warning(
@ -58,3 +56,5 @@ async def get_axis_api(
except axis.AxisException as err:
LOGGER.exception("Unknown Axis communication error occurred")
raise AuthenticationRequired from err
return api