@@ -30,11 +30,10 @@ def basic_auth_str(user: str, pwd: str) -> str:
3030
3131DataClass = 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
4039class 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-
7871class 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-
9077class 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+
9689class 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
@@ -399,7 +392,7 @@ def get_status(self) -> GameStatus:
399392 resp_json = loads (resp [1 ])
400393 if self .v :
401394 print (f"It is { resp_json ['unix_time' ]} seconds since the epoch." )
402- return GameStatus (Time (resp_json ['unix_time' ]), resp_json ['status' ]['score' ])
395+ return GameStatus (Time (resp_json ['unix_time' ]), resp_json ['status' ]['score' ], resp_json [ 'CubeServer_version' ] )
403396
404397 def sync_time (self ) -> bool :
405398 """Syncs the current clock against the server"""
0 commit comments