city_retrofit/city_model_structure/iot/station.py

43 lines
905 B
Python
Raw Normal View History

2022-03-24 19:06:47 -04:00
"""
Station
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
2022-03-24 19:06:47 -04:00
"""
import uuid
from city_model_structure.iot.sensor import Sensor
class Station:
def __init__(self, station_id=None, _mobile=False):
self._id = station_id
self._mobile = _mobile
self._sensors = []
@property
def id(self):
"""
Get the station id a random uuid will be assigned if no ID was provided to the constructor
:return: Id
"""
if self._id is None:
self._id = uuid.uuid4()
return self._id
@property
def _mobile(self):
"""
Get if the station is mobile or not
:return: bool
"""
return self._mobile
@property
def sensors(self) -> [Sensor]:
"""
Get the sensors belonging to the station
:return: [Sensor]
"""
return self._sensors