diff --git a/homeassistant/components/push/camera.py b/homeassistant/components/push/camera.py index 603fe89d542..7c1d37712bb 100644 --- a/homeassistant/components/push/camera.py +++ b/homeassistant/components/push/camera.py @@ -61,7 +61,7 @@ async def async_setup_platform( if PUSH_CAMERA_DATA not in hass.data: hass.data[PUSH_CAMERA_DATA] = {} - webhook_id = config.get(CONF_WEBHOOK_ID) + webhook_id = config[CONF_WEBHOOK_ID] cameras = [ PushCamera( @@ -101,16 +101,27 @@ async def handle_webhook( class PushCamera(Camera): """The representation of a Push camera.""" - def __init__(self, hass, name, buffer_size, timeout, image_field, webhook_id): + _attr_motion_detection_enabled = False + name: str + + def __init__( + self, + hass: HomeAssistant, + name: str, + buffer_size: int, + timeout: timedelta, + image_field: str, + webhook_id: str, + ) -> None: """Initialize push camera component.""" super().__init__() - self._name = name + self._attr_name = name self._last_trip = None self._filename = None self._expired_listener = None self._timeout = timeout - self.queue = deque([], buffer_size) - self._current_image = None + self.queue: deque[bytes] = deque([], buffer_size) + self._current_image: bytes | None = None self._image_field = image_field self.webhook_id = webhook_id self.webhook_url = webhook.async_generate_url(hass, webhook_id) @@ -171,16 +182,6 @@ class PushCamera(Camera): return self._current_image - @property - def name(self): - """Return the name of this camera.""" - return self._name - - @property - def motion_detection_enabled(self): - """Camera Motion Detection Status.""" - return False - @property def extra_state_attributes(self): """Return the state attributes."""