domain.sensors.Sensor.__init__()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 4
dl 0
loc 5
rs 10
c 0
b 0
f 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