Ezviz image entity cleanup (#96548)

* Update image.py

* Inheratance format
This commit is contained in:
Renier Moorcroft 2023-07-17 08:30:17 +02:00 committed by GitHub
parent 33d2dd3797
commit d553a749a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,6 @@ from .coordinator import EzvizDataUpdateCoordinator
from .entity import EzvizEntity from .entity import EzvizEntity
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
GET_IMAGE_TIMEOUT = 10
IMAGE_TYPE = ImageEntityDescription( IMAGE_TYPE = ImageEntityDescription(
key="last_motion_image", key="last_motion_image",
@ -52,7 +51,7 @@ class EzvizLastMotion(EzvizEntity, ImageEntity):
self, hass: HomeAssistant, coordinator: EzvizDataUpdateCoordinator, serial: str self, hass: HomeAssistant, coordinator: EzvizDataUpdateCoordinator, serial: str
) -> None: ) -> None:
"""Initialize a image entity.""" """Initialize a image entity."""
super().__init__(coordinator, serial) EzvizEntity.__init__(self, coordinator, serial)
ImageEntity.__init__(self, hass) ImageEntity.__init__(self, hass)
self._attr_unique_id = f"{serial}_{IMAGE_TYPE.key}" self._attr_unique_id = f"{serial}_{IMAGE_TYPE.key}"
self.entity_description = IMAGE_TYPE self.entity_description = IMAGE_TYPE