Fixed acknowledgments
This commit is contained in:
@@ -658,12 +658,7 @@ def _process_single_reservation(
|
|||||||
else:
|
else:
|
||||||
raise ValueError("Unsupported message type: %s", message_type.value)
|
raise ValueError("Unsupported message type: %s", message_type.value)
|
||||||
|
|
||||||
unique_id_str = reservation.unique_id
|
unique_id_str = reservation.md5_unique_id
|
||||||
|
|
||||||
# TODO MAGIC shortening
|
|
||||||
if len(unique_id_str) > 32:
|
|
||||||
# strip to first 35 chars
|
|
||||||
unique_id_str = unique_id_str[:32]
|
|
||||||
|
|
||||||
# UniqueID
|
# UniqueID
|
||||||
unique_id = UniqueId(type_value=UniqueIdType2.VALUE_14, id=unique_id_str)
|
unique_id = UniqueId(type_value=UniqueIdType2.VALUE_14, id=unique_id_str)
|
||||||
|
|||||||
@@ -21,12 +21,19 @@ from xsdata.formats.dataclass.serializers.config import SerializerConfig
|
|||||||
from xsdata_pydantic.bindings import XmlParser, XmlSerializer
|
from xsdata_pydantic.bindings import XmlParser, XmlSerializer
|
||||||
|
|
||||||
from alpine_bits_python.alpine_bits_helpers import (
|
from alpine_bits_python.alpine_bits_helpers import (
|
||||||
create_res_notif_push_message, create_res_retrieve_response)
|
create_res_notif_push_message,
|
||||||
|
create_res_retrieve_response,
|
||||||
|
)
|
||||||
|
|
||||||
from .db import AckedRequest, Customer, Reservation
|
from .db import AckedRequest, Customer, Reservation
|
||||||
from .generated.alpinebits import (OtaNotifReportRq, OtaNotifReportRs,
|
from .generated.alpinebits import (
|
||||||
OtaPingRq, OtaPingRs, OtaReadRq,
|
OtaNotifReportRq,
|
||||||
WarningStatus)
|
OtaNotifReportRs,
|
||||||
|
OtaPingRq,
|
||||||
|
OtaPingRs,
|
||||||
|
OtaReadRq,
|
||||||
|
WarningStatus,
|
||||||
|
)
|
||||||
|
|
||||||
# Configure logging
|
# Configure logging
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
@@ -518,7 +525,7 @@ class ReadAction(AlpineBitsAction):
|
|||||||
select(Reservation.id)
|
select(Reservation.id)
|
||||||
.join(
|
.join(
|
||||||
AckedRequest,
|
AckedRequest,
|
||||||
Reservation.unique_id.like(str(AckedRequest.unique_id) + "%"),
|
Reservation.md5_unique_id == AckedRequest.unique_id,
|
||||||
)
|
)
|
||||||
.filter(AckedRequest.client_id == client_info.client_id)
|
.filter(AckedRequest.client_id == client_info.client_id)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user