Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions custom_components/kuna/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def device_state_attributes(self):

def update(self):
"""Fetch state data from the updated account camera dict."""
self.is_streaming = True
"""self.is_streaming = True"""
self._is_streaming = True
try:
self._camera = self._account.account.cameras[self._original_id]
except KeyError:
Expand All @@ -118,7 +119,10 @@ async def async_added_to_hass(self):
def _ready_for_snapshot(self, now):
return self._next_snapshot_at is None or now > self._next_snapshot_at

async def async_camera_image(self):
"""async def async_camera_image(self):"""
async def async_camera_image(
self, width: int | None = None, height: int | None = None
) -> bytes | None:
"""Get and return an image from the camera, only once every stream_interval seconds."""
stream_interval = timedelta(seconds=self._config[CONF_STREAM_INTERVAL])
now = utcnow()
Expand Down