diff --git a/homeassistant/components/august/camera.py b/homeassistant/components/august/camera.py index 01baf7aa51a..f8541388ec2 100644 --- a/homeassistant/components/august/camera.py +++ b/homeassistant/components/august/camera.py @@ -6,8 +6,7 @@ import logging from aiohttp import ClientSession from yalexs.activity import ActivityType -from yalexs.const import Brand -from yalexs.doorbell import ContentTokenExpired, Doorbell +from yalexs.doorbell import Doorbell from yalexs.util import update_doorbell_image_from_activity from homeassistant.components.camera import Camera @@ -46,7 +45,6 @@ class AugustCamera(AugustEntityMixin, Camera): _attr_motion_detection_enabled = True _attr_brand = DEFAULT_NAME _image_url: str | None = None - _content_token: str | None = None _image_content: bytes | None = None def __init__( @@ -91,24 +89,9 @@ class AugustCamera(AugustEntityMixin, Camera): self._update_from_data() if self._image_url is not self._detail.image_url: - self._image_url = self._detail.image_url - self._content_token = self._detail.content_token or self._content_token - _LOGGER.debug( - "calling doorbell async_get_doorbell_image, %s", - self._detail.device_name, + self._image_content = await self._data.async_get_doorbell_image( + self._device_id, self._session, timeout=self._timeout ) - try: - self._image_content = await self._detail.async_get_doorbell_image( - self._session, timeout=self._timeout - ) - except ContentTokenExpired: - if self._data.brand == Brand.YALE_HOME: - _LOGGER.debug( - "Error fetching camera image, updating content-token from api to retry" - ) - await self._async_update() - self._image_content = await self._detail.async_get_doorbell_image( - self._session, timeout=self._timeout - ) + self._image_url = self._detail.image_url return self._image_content diff --git a/homeassistant/components/august/data.py b/homeassistant/components/august/data.py index 59c37dfd2b1..55c7c2bfa03 100644 --- a/homeassistant/components/august/data.py +++ b/homeassistant/components/august/data.py @@ -2,9 +2,7 @@ from __future__ import annotations -from yalexs.const import DEFAULT_BRAND from yalexs.lock import LockDetail -from yalexs.manager.const import CONF_BRAND from yalexs.manager.data import YaleXSData from yalexs_ble import YaleXSBLEDiscovery @@ -51,14 +49,8 @@ class AugustData(YaleXSData): ) -> None: """Init August data object.""" self._hass = hass - self._config_entry = config_entry super().__init__(august_gateway, HomeAssistantError) - @property - def brand(self) -> str: - """Brand of the device.""" - return self._config_entry.data.get(CONF_BRAND, DEFAULT_BRAND) - @callback def async_offline_key_discovered(self, detail: LockDetail) -> None: """Handle offline key discovery.""" diff --git a/homeassistant/components/august/manifest.json b/homeassistant/components/august/manifest.json index 923cb11c248..d4f82fa0aa1 100644 --- a/homeassistant/components/august/manifest.json +++ b/homeassistant/components/august/manifest.json @@ -28,5 +28,5 @@ "documentation": "https://www.home-assistant.io/integrations/august", "iot_class": "cloud_push", "loggers": ["pubnub", "yalexs"], - "requirements": ["yalexs==6.1.0", "yalexs-ble==2.4.2"] + "requirements": ["yalexs==6.3.0", "yalexs-ble==2.4.2"] } diff --git a/requirements_all.txt b/requirements_all.txt index 7415ffa9e33..06cff18617c 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2939,7 +2939,7 @@ yalesmartalarmclient==0.3.9 yalexs-ble==2.4.2 # homeassistant.components.august -yalexs==6.1.0 +yalexs==6.3.0 # homeassistant.components.yeelight yeelight==0.7.14 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 20e5977656d..a83481f2316 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2295,7 +2295,7 @@ yalesmartalarmclient==0.3.9 yalexs-ble==2.4.2 # homeassistant.components.august -yalexs==6.1.0 +yalexs==6.3.0 # homeassistant.components.yeelight yeelight==0.7.14 diff --git a/tests/components/august/mocks.py b/tests/components/august/mocks.py index 2b9b401e107..62c01d38d0c 100644 --- a/tests/components/august/mocks.py +++ b/tests/components/august/mocks.py @@ -213,7 +213,7 @@ async def _create_august_api_with_devices( async def _mock_setup_august_with_api_side_effects( hass, api_call_side_effects, pubnub, brand=Brand.AUGUST ): - api_instance = MagicMock(name="Api") + api_instance = MagicMock(name="Api", brand=brand) if api_call_side_effects["get_lock_detail"]: type(api_instance).async_get_lock_detail = AsyncMock(