FIX: lowercase MAC normalization across project v0.1

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2026-02-07 13:44:50 +11:00
parent 3734c43284
commit 946ad00253
22 changed files with 164 additions and 257 deletions

View File

@@ -64,9 +64,9 @@ ALLOWED_EVENT_TYPES = Literal[
def validate_mac(value: str) -> str:
"""Validate and normalize MAC address format."""
# Allow "Internet" as a special case for the gateway/WAN device
# Allow "internet" as a special case for the gateway/WAN device
if value.lower() == "internet":
return "Internet"
return "internet"
if not is_mac(value):
raise ValueError(f"Invalid MAC address format: {value}")
@@ -439,7 +439,7 @@ class DeviceUpdateRequest(BaseModel):
def sanitize_text_fields(cls, v: Optional[str]) -> Optional[str]:
if v is None:
return v
return sanitize_string(v)
return v
class DeleteDevicesRequest(BaseModel):