8000 Fix issue with showing correct version after restore by ludeeus · Pull Request #2283 · hacs/integration · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix issue with showing correct version after restore #2283

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

Merged
merged 1 commit into from
Nov 13, 2021
Merged
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
15 changes: 13 additions & 2 deletions custom_components/hacs/helpers/properties/pending_update.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# pylint: disable=missing-class-docstring,missing-module-docstring,missing-function-docstring,no-member
from abc import ABC

from awesomeversion import AwesomeVersion, AwesomeVersionException


class RepositoryPropertyPendingUpdate(ABC):
@property
Expand All @@ -13,8 +15,17 @@ def pending_update(self) -> bool:
if self.data.installed_commit != self.data.last_commit:
return True
return False
if self.display_installed_version != self.display_available_version:
return True
if self.display_version_or_commit == "commit":
if self.display_installed_version != self.display_available_version:
return True
else:
try:
return AwesomeVersion(self.display_available_version) > AwesomeVersion(
self.display_installed_version
)
except AwesomeVersionException:
# Assume pending_update on failure
return True
return False

@property
Expand Down
0