74 lines
1.2 KiB
Python
74 lines
1.2 KiB
Python
"""
|
|
Sensor module
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
|
"""
|
|
|
|
from helpers.location import Location
|
|
|
|
|
|
class Sensor:
|
|
"""
|
|
Sensor abstract class
|
|
"""
|
|
def __init__(self):
|
|
self._name = None
|
|
self._type = None
|
|
self._units = None
|
|
self._location = None
|
|
|
|
@property
|
|
def name(self):
|
|
"""
|
|
Get sensor name
|
|
:return: str
|
|
"""
|
|
return self._name
|
|
|
|
@name.setter
|
|
def name(self, value):
|
|
"""
|
|
Set sensor name
|
|
:param value: str
|
|
"""
|
|
self._name = value
|
|
|
|
@property
|
|
def type(self):
|
|
"""
|
|
Get sensor type
|
|
:return: str
|
|
"""
|
|
return self._type
|
|
|
|
@property
|
|
def units(self):
|
|
"""
|
|
Get sensor units
|
|
:return: str
|
|
"""
|
|
return self._units
|
|
|
|
@property
|
|
def location(self) -> Location:
|
|
"""
|
|
Get sensor location
|
|
:return: Location
|
|
"""
|
|
return self._location
|
|
|
|
@location.setter
|
|
def location(self, value):
|
|
"""
|
|
Set sensor location
|
|
:param value: Location
|
|
"""
|
|
self._location = value
|
|
|
|
@property
|
|
def measures(self):
|
|
"""
|
|
Sensor measures
|
|
"""
|
|
raise NotImplementedError
|