Skip to content

Ring camera fix#30975

Merged
balloob merged 4 commits into
home-assistant:devfrom
steve-gombos:ring-camera-fix
Jan 19, 2020
Merged

Ring camera fix#30975
balloob merged 4 commits into
home-assistant:devfrom
steve-gombos:ring-camera-fix

Conversation

@steve-gombos
Copy link
Copy Markdown
Contributor

Description:

The ring API generates a unique URL valid for an hour which is used in the camera component. There is a utcnow check in the HA ring component that is always static, so it is always early returning. This PR updates the utcnow checks in the Ring camera component to generate a new URL every 45 minutes.

fixes python-ring-doorbell/python-ring-doorbell#191

@probot-home-assistant
Copy link
Copy Markdown

Hey there @balloob, mind taking a look at this pull request as its been labeled with a integration (ring) you are listed as a codeowner for? Thanks!

self._last_video_id = None
self._video_url = None
self._expires_at = self._utcnow
self._expires_at = dt_util.utcnow()
Copy link
Copy Markdown
Member

@balloob balloob Jan 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be forcing an expiration, so:

Suggested change
self._expires_at = dt_util.utcnow()
self._expires_at = dt_util.utcnow() - FORCE_REFRESH_INTERVAL

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess it doesn't matter. It's None anyway.

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch !

@balloob balloob added this to the 0.104.3 milestone Jan 19, 2020
@balloob balloob merged commit 8fcd0e9 into home-assistant:dev Jan 19, 2020
@steve-gombos steve-gombos deleted the ring-camera-fix branch January 19, 2020 22:35
frenck pushed a commit that referenced this pull request Jan 21, 2020
* Fix ring camera entities

* Reverted test refresh interval

* Fix black errors
@frenck frenck mentioned this pull request Jan 21, 2020
@lock lock Bot locked and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Video unavailable after 1 hour

4 participants