Update free_rooms is_closing season detection. Should also accept 1 as True

This commit is contained in:
Jonas Linter
2025-12-09 14:45:22 +01:00
parent 13e404d07c
commit c73747e02d
2 changed files with 7 additions and 2 deletions

View File

@@ -842,4 +842,4 @@ class AlpineBitsServer:
# Ensure FreeRoomsAction is registered with ServerCapabilities discovery
#from .free_rooms_action import FreeRoomsAction
from .free_rooms_action import FreeRoomsAction

View File

@@ -586,7 +586,12 @@ class FreeRoomsAction(AlpineBitsAction):
self,
sac: OtaHotelInvCountNotifRq.Inventories.Inventory.StatusApplicationControl,
) -> bool:
return (sac.all_inv_code or "").strip().lower() == "true"
"""Check if AllInvCode is a truthy boolean value.
Accepts: "true", "True", "TRUE", "1", "yes", "Yes", "YES", etc.
"""
value = (sac.all_inv_code or "").strip().lower()
return value in ("true", "1", "yes")
def _extract_counts(
self,