Skip to content

Commit

Permalink
add sources to enums
Browse files Browse the repository at this point in the history
  • Loading branch information
silvioheinze committed Oct 5, 2024
1 parent 2c55ad3 commit aa54984
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions code/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def get_name(cls, dimension_id: int) -> str:
"""
return cls._names.get(dimension_id, "Unknown")


class SensorModel():
SEN5X = 1
BMP280 = 2
Expand Down Expand Up @@ -109,10 +110,32 @@ class SensorModel():
@classmethod
def get_sensor_name(cls, sensor_model):
return cls._names.get(sensor_model, "Unknown Sensor")



class LdProduct():
AIR_AROUND = 1
AIR_CUBE = 2
AIR_STATION = 3
AIR_BADGE = 4
AIR_BIKE = 5
AIR_BIKE = 5


class Source():
LD = 1
LDTTN = 2
SC = 3

_names = {
LD: "Luftdaten.at",
LDTTN: "Luftdaten.at TTN LoRaWAN",
SC: "sensor.community"
}

@classmethod
def get_name(cls, source_id: int) -> str:
"""
Gibt den Namen der angegebenen Source zurück.
:param source_id: Die ID der Source
:return: Der zugehörige Name oder 'Unknown', wenn kein Name vorhanden ist
"""
return cls._names.get(source_id, "Unknown")

0 comments on commit aa54984

Please sign in to comment.