Total Complexity | 2 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | '''Sensor entities''' |
||
2 | import datetime |
||
3 | |||
4 | class Sensor(object): |
||
5 | """A Sesnor""" |
||
6 | def __init__(self, sensorid='', sensortype='', location=''): |
||
7 | self.sensortype = sensortype |
||
8 | #it is expected that from sensorid could be found location, type and other details |
||
9 | self.sensorid = sensorid |
||
10 | self.location = location |
||
11 | |||
12 | |||
13 | class SensorValue(object): |
||
14 | """A Sesnor Reading""" |
||
15 | |||
16 | def __init__(self, sensorid='', value='', valuetype='', sensor=None, sensortime=datetime.datetime.utcnow()): |
||
17 | self.sensorid = sensorid |
||
18 | self.valuetype = valuetype |
||
19 | self.value = value |
||
20 | self.sensor = sensor |
||
21 | self.sensortime = sensortime |
||
22 |