make locateibeaconpeerschema a bit more forgiving

This commit is contained in:
Laura Klünder 2024-12-26 16:00:18 +01:00
parent ce6e8e8269
commit 710ec5411a

View file

@ -1,4 +1,4 @@
from typing import Annotated, Union from typing import Annotated, Union, Optional
from uuid import UUID from uuid import UUID
from annotated_types import Lt from annotated_types import Lt
@ -87,10 +87,12 @@ class LocateIBeaconPeerSchema(BaseSchema):
minor: Annotated[NonNegativeInt, Lt(2 ** 16)] = APIField( minor: Annotated[NonNegativeInt, Lt(2 ** 16)] = APIField(
title="minor value of the iBeacon", title="minor value of the iBeacon",
) )
distance: NonNegativeFloat = APIField( distance: Optional[NonNegativeFloat] = APIField(
default=None,
title="determined iBeacon distance in meters", title="determined iBeacon distance in meters",
) )
last_seen_ago: NonNegativeInt = APIField( last_seen_ago: Optional[NonNegativeInt ]= APIField(
default=None,
title="how many milliseconds ago this beacon was last seen" title="how many milliseconds ago this beacon was last seen"
) )