Skip to content

Commit c8f889c

Browse files
committed
Changed BatteryLevel unit from % to V
1 parent bfd63ef commit c8f889c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

servercom/implementations/circuitpy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class DataPoint():
4545
def UNIT() -> str:
4646
"""A standard string representation of the unit for this datapoint"""
4747

48-
def __init__(self, data_class: DataClass, value: Union[int, float, str]):
48+
def __init__(self, data_class: DataClass, value: int | float | str):
4949
"""Initializes a piece of data to send to the server"""
5050
self.data_class = data_class
5151
self.value = value
@@ -88,8 +88,8 @@ def __init__(self, value: str):
8888

8989
class BatteryLevel(DataPoint):
9090
"""A class reserved for DataPoints that are intended as an indication of battery level"""
91-
UNIT="%" # No unit for regular strings of text
92-
def __init__(self, value: int):
91+
UNIT="V"
92+
def __init__(self, value: float):
9393
super().__init__(DataClass.BATTERY, value)
9494

9595
class AuthorizationError(ConnectionError):

servercom/implementations/cpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(self, value: str):
7575

7676
class BatteryLevel(DataPoint):
7777
"""A class reserved for DataPoints that are intended as an indication of battery level"""
78-
UNIT="%" # No unit for regular strings of text
78+
UNIT="V"
7979
def __init__(self, value: int):
8080
super().__init__(DataClass.BATTERY, value)
8181

0 commit comments

Comments
 (0)