From 6a3ade3304690fae257a58e3f113ba22293b9c24 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 31 Mar 2023 22:50:47 +0200 Subject: [PATCH] Added `common.sensors` package. The package contains the base types and constants shared across sensor-based integrations. --- platypush/common/sensors.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 platypush/common/sensors.py diff --git a/platypush/common/sensors.py b/platypush/common/sensors.py new file mode 100644 index 00000000..f04ca5a2 --- /dev/null +++ b/platypush/common/sensors.py @@ -0,0 +1,11 @@ +from typing import Iterable, Mapping, Union + +Numeric = Union[float, int] +SensorDataType = Union[Numeric, Mapping[str, Numeric], Iterable[Numeric]] +""" +Numeric sensor data published by integrations can be either of: + + - ``int``/``float`` + - Mapping of ``str -> int/float`` + - List of ``int``/``float`` +"""