Image entity key error when camera is ignored in EZVIZ (#134343)
parent
13a7ad759c
commit
23e04ced9c
|
@ -8,7 +8,7 @@ from pyezviz.exceptions import PyEzvizError
|
|||
from pyezviz.utils import decrypt_image
|
||||
|
||||
from homeassistant.components.image import Image, ImageEntity, ImageEntityDescription
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.config_entries import SOURCE_IGNORE, ConfigEntry
|
||||
from homeassistant.const import CONF_PASSWORD
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
@ -57,7 +57,9 @@ class EzvizLastMotion(EzvizEntity, ImageEntity):
|
|||
)
|
||||
camera = hass.config_entries.async_entry_for_domain_unique_id(DOMAIN, serial)
|
||||
self.alarm_image_password = (
|
||||
camera.data[CONF_PASSWORD] if camera is not None else None
|
||||
camera.data[CONF_PASSWORD]
|
||||
if camera and camera.source != SOURCE_IGNORE
|
||||
else None
|
||||
)
|
||||
|
||||
async def _async_load_image_from_url(self, url: str) -> Image | None:
|
||||
|
|
Loading…
Reference in New Issue