-
-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Improve reolink generic typing #88786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |||||||||||||||
| from __future__ import annotations | ||||||||||||||||
|
|
||||||||||||||||
| import logging | ||||||||||||||||
| from typing import Any | ||||||||||||||||
| from typing import Any, Literal | ||||||||||||||||
|
|
||||||||||||||||
| from reolink_aio.exceptions import ReolinkError | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -34,7 +34,9 @@ async def async_setup_entry( | |||||||||||||||
| async_add_entities([ReolinkUpdateEntity(reolink_data)]) | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| class ReolinkUpdateEntity(ReolinkBaseCoordinatorEntity, UpdateEntity): | ||||||||||||||||
| class ReolinkUpdateEntity( | ||||||||||||||||
| ReolinkBaseCoordinatorEntity[str | Literal[False]], UpdateEntity | ||||||||||||||||
| ): | ||||||||||||||||
| """Update entity for a Netgear device.""" | ||||||||||||||||
|
|
||||||||||||||||
| _attr_device_class = UpdateDeviceClass.FIRMWARE | ||||||||||||||||
|
|
@@ -59,9 +61,6 @@ def installed_version(self) -> str | None: | |||||||||||||||
| @property | ||||||||||||||||
| def latest_version(self) -> str | None: | ||||||||||||||||
| """Latest version available for install.""" | ||||||||||||||||
| if self.coordinator.data is None: | ||||||||||||||||
| return None | ||||||||||||||||
|
|
||||||||||||||||
|
Comment on lines
62
to
64
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the check for new firmware fails, it will raise either a core/homeassistant/components/reolink/__init__.py Lines 85 to 91 in e00ff54
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, this can indeed be removed. |
||||||||||||||||
| if not self.coordinator.data: | ||||||||||||||||
| return self.installed_version | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.