updating to latest
This commit is contained in:
15
custom_components/hacs/utils/version.py
Normal file
15
custom_components/hacs/utils/version.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""Version utils."""
|
||||
|
||||
|
||||
from functools import lru_cache
|
||||
|
||||
from awesomeversion import AwesomeVersion, AwesomeVersionException
|
||||
|
||||
|
||||
@lru_cache(maxsize=1024)
|
||||
def version_left_higher_then_right(left: str, right: str) -> bool:
|
||||
"""Return a bool if source is newer than target, will also be true if identical."""
|
||||
try:
|
||||
return AwesomeVersion(left) >= AwesomeVersion(right)
|
||||
except AwesomeVersionException:
|
||||
return False
|
||||
Reference in New Issue
Block a user