From 62e549015ec8aab235246fbc2c840aca4cb72dd8 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Sun, 7 Apr 2019 03:39:16 +0200 Subject: [PATCH] Randomised battery. --- server/nightr/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/nightr/util.py b/server/nightr/util.py index 82725a1..5985465 100644 --- a/server/nightr/util.py +++ b/server/nightr/util.py @@ -1,4 +1,5 @@ import base64 +import random from dataclasses import dataclass, field from pathlib import Path from typing import List, Dict @@ -9,7 +10,7 @@ import numpy as np @dataclass class Context: - battery: int = 55 + battery: int = field(default_factory=lambda: random.randint(0, 100)) position: Dict[str, float] = field(default_factory=lambda: {'latitude': 53.0, 'longitude': 9.0}) # Denmark somewhere image: np.ndarray = None