Skip to content

Commit

Permalink
Fixing async_camera_image signature & using extra_state_attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin David authored Apr 10, 2022
1 parent 5bd168a commit 2c66b60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/kuna/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def device_info(self):
}

@property
def device_state_attributes(self):
def extra_state_attributes(self):
attributes = {
ATTR_SERIAL_NUMBER: self._camera.serial_number,
ATTR_NOTIFICATIONS_ENABLED: self._camera.notifications_enabled,
Expand Down Expand Up @@ -118,7 +118,7 @@ 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, width: int | None = None, height: int | None = 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

0 comments on commit 2c66b60

Please sign in to comment.