Skip to content

Commit a0479ba

Browse files
committed
Updated API datapoint types
1 parent ece4c2a commit a0479ba

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

servercom/implementations/circuitpy.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ def basic_auth_str(user: str, pwd: str) -> str:
3030

3131
DataClass = enum(
3232
TEMPERATURE = "temperature",
33-
HUMIDITY = "humidity",
3433
PRESSURE = "pressure",
35-
LIGHT_INTENSITY = "light intensity",
3634
COMMENT = "comment",
37-
BATTERY = "remaining battery"
35+
BATTERY = "remaining battery",
36+
BEACON = "beacon challenge"
3837
)
3938

4039
class DataPoint():
@@ -69,30 +68,24 @@ class Temperature(DataPoint):
6968
def __init__(self, value):
7069
super().__init__(DataClass.TEMPERATURE, value)
7170

72-
class Humidity(DataPoint):
73-
"""A class for DataPoints that store humidity values"""
74-
UNIT = "%"
75-
def __init__(self, value):
76-
super().__init__(DataClass.HUMIDITY, value)
77-
7871
class Pressure(DataPoint):
7972
"""A class for DataPoints that store barometric pressure values"""
8073
UNIT="inHg"
8174
def __init__(self, value):
8275
super().__init__(DataClass.PRESSURE, value)
8376

84-
class Intensity(DataPoint):
85-
"""A class for DataPoints that store light intensity values"""
86-
UNIT="lux"
87-
def __init__(self, value):
88-
super().__init__(DataClass.LIGHT_INTENSITY, value)
89-
9077
class Text(DataPoint):
9178
"""A class reserved for DataPoints that are intended as a text comment"""
9279
UNIT="" # No unit for regular strings of text
9380
def __init__(self, value: str):
9481
super().__init__(DataClass.COMMENT, value)
9582

83+
class BeaconChallenge(DataPoint):
84+
"""A class reserved for DataPoints that are in response to a message from the beacon"""
85+
UNIT="" # No unit for regular strings of text
86+
def __init__(self, value: str):
87+
super().__init__(DataClass.BEACON, value)
88+
9689
class BatteryLevel(DataPoint):
9790
"""A class reserved for DataPoints that are intended as an indication of battery level"""
9891
UNIT="%" # No unit for regular strings of text

0 commit comments

Comments
 (0)