Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion openevsehttp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_awesome_version(version: str) -> AwesomeVersion:
# We use custom word boundary checks to avoid false positives like 'domain' matching 'main'
# or 'webmaster' matching 'master'.
is_dev = False
if re.search(r"[^/]+/[^_]+_[a-fA-F0-9]{6,40}_modified$", version, re.IGNORECASE):
if re.search(r"_modified$", version, re.IGNORECASE):
is_dev = True
elif re.search(
r"(?:^|[^a-zA-Z0-9])(master|main)(?:[^a-zA-Z0-9]|$)", version, re.IGNORECASE
Expand Down
5 changes: 4 additions & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ async def test_version_check_dev_branches():
charger._config = {"version": "feature_1A2B3C"}
assert charger._version_check("2.0.0") is True

# Local dev build templates (category/branch_hash_modified) - treated as dev, returns True
# Suffix matching for _modified - treated as dev, returns True
charger._config = {
"version": "local_feature/gui-nightshift-default_2bcdf1d0_modified"
}
Expand All @@ -680,6 +680,9 @@ async def test_version_check_dev_branches():
charger._config = {"version": "custom_branch/my-feature_abc123_modified"}
assert charger._version_check("2.0.0") is True

charger._config = {"version": "main_modified"}
assert charger._version_check("2.0.0") is True

# False positives containing 'main' or 'master' but not at word boundaries,
# ending in 6-char hashes without dev keywords, or other non-matching modified strings
# — should fail version check
Expand Down
Loading