Skip to content

Commit 241a11b

Browse files
committed
Implemented new data classes for cpy
1 parent a0479ba commit 241a11b

File tree

1 file changed

+7
-14
lines changed
  • servercom/implementations

1 file changed

+7
-14
lines changed

servercom/implementations/cpy.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818
# Helpers:
1919
class DataClass(str, Enum):
2020
TEMPERATURE = "temperature"
21-
HUMIDITY = "humidity"
2221
PRESSURE = "pressure"
23-
LIGHT_INTENSITY = "light intensity"
2422
COMMENT = "comment"
2523
BATTERY = "remaining battery"
24+
BEACON = "beacon challenge"
2625

2726
class DataPoint():
2827
"""A class for storing and handling datapoints"""
@@ -56,30 +55,24 @@ class Temperature(DataPoint):
5655
def __init__(self, value):
5756
super().__init__(DataClass.TEMPERATURE, value)
5857

59-
class Humidity(DataPoint):
60-
"""A class for DataPoints that store humidity values"""
61-
UNIT = "%"
62-
def __init__(self, value):
63-
super().__init__(DataClass.HUMIDITY, value)
64-
6558
class Pressure(DataPoint):
6659
"""A class for DataPoints that store barometric pressure values"""
6760
UNIT="inHg"
6861
def __init__(self, value):
6962
super().__init__(DataClass.PRESSURE, value)
7063

71-
class Intensity(DataPoint):
72-
"""A class for DataPoints that store light intensity values"""
73-
UNIT="lux"
74-
def __init__(self, value):
75-
super().__init__(DataClass.LIGHT_INTENSITY, value)
76-
7764
class Text(DataPoint):
7865
"""A class reserved for DataPoints that are intended as a text comment"""
7966
UNIT="" # No unit for regular strings of text
8067
def __init__(self, value: str):
8168
super().__init__(DataClass.COMMENT, value)
8269

70+
class BeaconChallenge(DataPoint):
71+
"""A class reserved for DataPoints that are in response to a message from the beacon"""
72+
UNIT="" # No unit for regular strings of text
73+
def __init__(self, value: str):
74+
super().__init__(DataClass.BEACON, value)
75+
8376
class BatteryLevel(DataPoint):
8477
"""A class reserved for DataPoints that are intended as an indication of battery level"""
8578
UNIT="%" # No unit for regular strings of text

0 commit comments

Comments
 (0)