From 404e1644db2eeb8022972e98037db925a0e5a5f5 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Fri, 31 May 2024 17:37:42 +0400 Subject: [PATCH] Refactor: add models.Device with req data generators --- models.py | 96 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 77 insertions(+), 19 deletions(-) diff --git a/models.py b/models.py index 17dbfbb..c0a0935 100644 --- a/models.py +++ b/models.py @@ -1,34 +1,92 @@ +from urllib.parse import quote + from dataclasses import dataclass -from typing import Any, Iterable +from typing import Collection + + +type Numeric = int | float @dataclass class SensorData: mac: str - value: Any + value: Numeric + # actually `time` is either decimal int, + # hex int or T