From ef41123264f7d37d3fba6d23eee1955142b26120 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Fri, 31 May 2024 17:41:41 +0400 Subject: [PATCH] Update fixtures (see prev commit) --- fixtures.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/fixtures.py b/fixtures.py index aa51400..9ab6095 100644 --- a/fixtures.py +++ b/fixtures.py @@ -1,19 +1,18 @@ import time - -from models import SensorData +from models import Device, GeoPosition, SensorData cur_time = int(time.time()) -device_mac = '9B-89-A9-ED-F2-FB' -device_name = 'My RaspberryPi 4B' -sensors = [ - SensorData('owner', 'darkcat09'), - SensorData('lat', 56), # just random data - SensorData('lon', 49), - SensorData('alt', 400), - SensorData('t1', 12.42, cur_time), # let it be temp outdoors - SensorData('t2', 22.50, cur_time, 'Temp in living room'), - SensorData('t3', 60.11, None, 'Poor Raspberry CPU...'), - SensorData('p1', 752.33, None, 'Barometer'), - SensorData('p2', 751.42), -] +device = Device( + '9B-89-A9-ED-F2-FB', + 'My RaspberryPi 4B', + 'darkcat09', + GeoPosition(56, 49, 400), # just random data + [ + SensorData('t1', 12.42, cur_time), # let it be temp outdoors + SensorData('t2', 22.50, cur_time, 'Temp in living room'), + SensorData('t3', 60.11, None, 'Poor Raspberry CPU...'), + SensorData('p1', 752.33, None, 'Barometer'), + SensorData('p2', 751.42), + ], +)