updating to latest
This commit is contained in:
23
custom_components/hacs/helpers/properties/pending_update.py
Normal file
23
custom_components/hacs/helpers/properties/pending_update.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# pylint: disable=missing-class-docstring,missing-module-docstring,missing-function-docstring,no-member
|
||||
from abc import ABC
|
||||
|
||||
|
||||
class RepositoryPropertyPendingUpdate(ABC):
|
||||
@property
|
||||
def pending_update(self) -> bool:
|
||||
if not self.can_install:
|
||||
return False
|
||||
if self.data.installed:
|
||||
if self.data.selected_tag is not None:
|
||||
if self.data.selected_tag == self.data.default_branch:
|
||||
if self.data.installed_commit != self.data.last_commit:
|
||||
return True
|
||||
return False
|
||||
if self.display_installed_version != self.display_available_version:
|
||||
return True
|
||||
return False
|
||||
|
||||
@property
|
||||
def pending_upgrade(self) -> bool:
|
||||
"""kept for legacy compatibility"""
|
||||
return self.pending_update
|
||||
Reference in New Issue
Block a user