Skip to content

Commit

Permalink
Add back current_version for compatibility (#2587)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Apr 2, 2022
1 parent 69972a5 commit 92b61a5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion custom_components/hacs/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def name(self) -> str | None:
@property
def latest_version(self) -> str:
"""Return latest version of the entity."""
return self.repository.display_available_version
if self.repository.pending_update:
return self.repository.display_available_version
return self.installed_version

@property
def release_url(self) -> str:
Expand All @@ -41,6 +43,11 @@ def release_url(self) -> str:
return f"https://github.com/{self.repository.data.full_name}"
return f"https://github.com/{self.repository.data.full_name}/releases/{self.latest_version}"

@property
def current_version(self) -> str:
"""Return downloaded version of the entity."""
return self.repository.display_installed_version

@property
def installed_version(self) -> str:
"""Return downloaded version of the entity."""
Expand Down

0 comments on commit 92b61a5

Please sign in to comment.