Skip to content

Commit 4d332e7

Browse files
committed
handle float timestamps
1 parent 4d8bea2 commit 4d332e7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = edge-ml
3-
version = 0.0.6
3+
version = 0.0.7
44
author = KIT/TECO
55
autor_email = info@edge-ml.org
66
description = Python library of edge-ml.org: end-to-end machine learning for embedded devices

src/edgeml/edgeml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ def __init__(self, url: str, key: str, name: str, useDeviceTime: bool) -> None:
5757
def addDataPoint(self, sensorName: str, value: float, time: int = None):
5858
if (self.error):
5959
raise self.error
60-
if (type(value) is not float): #TODO cast int to float, it may cause problems
60+
if (type(value) is not float): #TODO cast int to float, it may cause problems, can value be ever int?
6161
raise ValueError("Datapoint is not a number")
62-
if (not self.useDeviceTime and type(time) is not int):
62+
if (not self.useDeviceTime and type(time) is not int and type(time) is not float):
6363
raise ValueError("Provide a valid timestamp")
6464

6565
if (self.useDeviceTime):

0 commit comments

Comments
 (0)