From 299c77fb8ba48f6400d86d968ddd2fdb229ec85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Fri, 29 Mar 2024 18:01:35 +0100 Subject: [PATCH] some more fixes to the c formats --- src/c3nav/mesh/messages.py | 2 +- src/c3nav/mesh/schemas.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/c3nav/mesh/messages.py b/src/c3nav/mesh/messages.py index 36fd9d9b..f566f71b 100644 --- a/src/c3nav/mesh/messages.py +++ b/src/c3nav/mesh/messages.py @@ -184,7 +184,7 @@ class ConfigUplinkMessage(discriminator_value(msg_type=MeshMessageType.CONFIG_UP enabled: bool ssid: Annotated[str, MaxLen(32)] password: Annotated[str, MaxLen(64)] - channel: Annotated[PositiveInt, Le(15)] + channel: Annotated[NonNegativeInt, Le(15)] udp: bool ssl: bool host: Annotated[str, MaxLen(64)] diff --git a/src/c3nav/mesh/schemas.py b/src/c3nav/mesh/schemas.py index 7eeb08fc..9316f36c 100644 --- a/src/c3nav/mesh/schemas.py +++ b/src/c3nav/mesh/schemas.py @@ -59,9 +59,9 @@ class BoardSPIConfig(BaseModel): """ configuration for spi bus used for ETH or UWB """ - gpio_miso: Annotated[PositiveInt, Lt(2**8)] - gpio_mosi: Annotated[PositiveInt, Lt(2**8)] - gpio_clk: Annotated[PositiveInt, Lt(2**8)] + gpio_miso: Annotated[NonNegativeInt, Lt(2**8)] + gpio_mosi: Annotated[NonNegativeInt, Lt(2**8)] + gpio_clk: Annotated[NonNegativeInt, Lt(2**8)] class UWBConfig(BaseModel): @@ -69,11 +69,11 @@ class UWBConfig(BaseModel): configuration for the connection to the UWB module """ enable: bool - gpio_cs: Annotated[PositiveInt, Lt(2**8)] - gpio_irq: Annotated[PositiveInt, Lt(2**8)] - gpio_rst: Annotated[PositiveInt, Lt(2**8)] - gpio_wakeup: Annotated[PositiveInt, Lt(2**8)] - gpio_exton: Annotated[PositiveInt, Lt(2**8)] + gpio_cs: Annotated[NonNegativeInt, Lt(2**8)] + gpio_irq: Annotated[NonNegativeInt, Lt(2**8)] + gpio_rst: Annotated[NonNegativeInt, Lt(2**8)] + gpio_wakeup: Annotated[NonNegativeInt, Lt(2**8)] + gpio_exton: Annotated[NonNegativeInt, Lt(2**8)] class UplinkEthConfig(BaseModel):