From 673be4f7ddb0ad498948eb7fd37886d9a43e39aa Mon Sep 17 00:00:00 2001 From: Sean Vig Date: Sat, 31 Jul 2021 18:22:19 -0400 Subject: [PATCH] Bump Amcrest version to 1.8.0 (#53784) * Bump Amcrest version to 1.8.0 * Add codeowner to Amcrest. Co-authored-by: jan Iversen --- CODEOWNERS | 1 + homeassistant/components/amcrest/__init__.py | 8 ++++---- homeassistant/components/amcrest/camera.py | 2 +- homeassistant/components/amcrest/manifest.json | 4 ++-- requirements_all.txt | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 29906631254..371a03a0d91 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -37,6 +37,7 @@ homeassistant/components/alpha_vantage/* @fabaff homeassistant/components/ambee/* @frenck homeassistant/components/ambiclimate/* @danielhiversen homeassistant/components/ambient_station/* @bachya +homeassistant/components/amcrest/* @flacjacket homeassistant/components/analytics/* @home-assistant/core @ludeeus homeassistant/components/androidtv/* @JeffLIrion homeassistant/components/apache_kafka/* @bachya diff --git a/homeassistant/components/amcrest/__init__.py b/homeassistant/components/amcrest/__init__.py index 8d274f12044..20775688b1b 100644 --- a/homeassistant/components/amcrest/__init__.py +++ b/homeassistant/components/amcrest/__init__.py @@ -5,7 +5,7 @@ import logging import threading import aiohttp -from amcrest import AmcrestError, Http, LoginError +from amcrest import AmcrestError, ApiWrapper, LoginError import voluptuous as vol from homeassistant.auth.permissions.const import POLICY_CONTROL @@ -114,8 +114,8 @@ CONFIG_SCHEMA = vol.Schema( ) -class AmcrestChecker(Http): - """amcrest.Http wrapper for catching errors.""" +class AmcrestChecker(ApiWrapper): + """amcrest.ApiWrapper wrapper for catching errors.""" def __init__(self, hass, name, host, port, user, password): """Initialize.""" @@ -154,7 +154,7 @@ class AmcrestChecker(Http): ) def command(self, *args, **kwargs): - """amcrest.Http.command wrapper to catch errors.""" + """amcrest.ApiWrapper.command wrapper to catch errors.""" try: ret = super().command(*args, **kwargs) except LoginError as ex: diff --git a/homeassistant/components/amcrest/camera.py b/homeassistant/components/amcrest/camera.py index 92453d24144..5c7f8acf94a 100644 --- a/homeassistant/components/amcrest/camera.py +++ b/homeassistant/components/amcrest/camera.py @@ -571,7 +571,7 @@ class AmcrestCam(Camera): def _goto_preset(self, preset): """Move camera position and zoom to preset.""" try: - self._api.go_to_preset(action="start", preset_point_number=preset) + self._api.go_to_preset(preset_point_number=preset) except AmcrestError as error: log_update_error( _LOGGER, "move", self.name, f"camera to preset {preset}", error diff --git a/homeassistant/components/amcrest/manifest.json b/homeassistant/components/amcrest/manifest.json index 702e6a61487..acd93c4e2ed 100644 --- a/homeassistant/components/amcrest/manifest.json +++ b/homeassistant/components/amcrest/manifest.json @@ -2,8 +2,8 @@ "domain": "amcrest", "name": "Amcrest", "documentation": "https://www.home-assistant.io/integrations/amcrest", - "requirements": ["amcrest==1.7.2"], + "requirements": ["amcrest==1.8.0"], "dependencies": ["ffmpeg"], - "codeowners": [], + "codeowners": ["@flacjacket"], "iot_class": "local_polling" } diff --git a/requirements_all.txt b/requirements_all.txt index 9ff6d796e4f..61239fbbe36 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -266,7 +266,7 @@ ambee==0.3.0 ambiclimate==0.2.1 # homeassistant.components.amcrest -amcrest==1.7.2 +amcrest==1.8.0 # homeassistant.components.androidtv androidtv[async]==0.0.60