Skip to content

Commit

Permalink
Removing normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexarian committed Jan 14, 2025
1 parent 099141f commit a04be08
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions proxy/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@
import pypowerwall
from pypowerwall import parse_version


def normalize_caseless(text: str) -> str:
return unicodedata.normalize("NFKD", text.casefold())

def caseless_equal(left: str, right: str) -> bool:
return normalize_caseless(left) == normalize_caseless(right)

BUILD: Final[str] = "t67"
UTF_8: Final[str] = "utf-8"

Expand Down Expand Up @@ -904,12 +897,11 @@ def check_for_environmental_pw_configs() -> List[str]:
"""
suffixes_to_check = {"", "1"}
actual_configs = []
environment = [normalize_caseless(key) for key in os.environ]

environment = [key.lower() for key in os.environ]
while suffixes_to_check:
current_suffix = suffixes_to_check.pop()
test_suffix = f"_{current_suffix}" if current_suffix.isnumeric() else current_suffix
#if any( in (normalize_caseless(key) ) ):
if any(f"{config.value}{test_suffix}" in environment for config in CONFIG_TYPE):
actual_configs.append(test_suffix)
elif current_suffix.isnumeric() and int(current_suffix) > 1:
Expand Down

0 comments on commit a04be08

Please sign in to comment.