Make sure getting latest always takes into consideration non-version attributes
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b61e94005e
commit
e45dc59d1f
@ -120,7 +120,7 @@ class Unhacs:
|
||||
]
|
||||
|
||||
upgrade_packages: list[Package] = []
|
||||
latest_packages = [Package(url=p.url) for p in installed_packages]
|
||||
latest_packages = [p.get_latest() for p in installed_packages]
|
||||
for installed_package, latest_package in zip(
|
||||
installed_packages, latest_packages
|
||||
):
|
||||
|
@ -279,6 +279,11 @@ class Package:
|
||||
installed_package = self.installed_package(hass_config_path)
|
||||
return installed_package is None or installed_package.version != self.version
|
||||
|
||||
def get_latest(self) -> "Package":
|
||||
package = self.to_yaml()
|
||||
package.pop("version")
|
||||
return Package(**package)
|
||||
|
||||
|
||||
def get_installed_packages(
|
||||
hass_config_path: Path = DEFAULT_HASS_CONFIG_PATH,
|
||||
|
Loading…
Reference in New Issue
Block a user