|
10 | 10 | from dataclasses import dataclass |
11 | 11 | from datetime import datetime |
12 | 12 | from functools import reduce |
13 | | -from typing import Optional |
| 13 | +from typing import Optional, List, Tuple |
14 | 14 |
|
15 | 15 | import parse # type: ignore[import-untyped] |
16 | 16 | import platformdirs |
@@ -39,10 +39,10 @@ class LogDef: |
39 | 39 | """Log definition.""" |
40 | 40 |
|
41 | 41 | code: str # i.e. PM or B or whatever... see meshtastic slog documentation |
42 | | - fields: list[tuple[str, pa.DataType]] # A list of field names and their arrow types |
| 42 | + fields: List[Tuple[str, pa.DataType]] # A list of field names and their arrow types |
43 | 43 | format: parse.Parser # A format string that can be used to parse the arguments |
44 | 44 |
|
45 | | - def __init__(self, code: str, fields: list[tuple[str, pa.DataType]]) -> None: |
| 45 | + def __init__(self, code: str, fields: List[Tuple[str, pa.DataType]]) -> None: |
46 | 46 | """Initialize the LogDef object. |
47 | 47 |
|
48 | 48 | code (str): The code. |
@@ -93,7 +93,7 @@ def __init__(self, pMeter: PowerMeter, file_path: str, interval=0.002) -> None: |
93 | 93 | ) |
94 | 94 | self.thread.start() |
95 | 95 |
|
96 | | - def store_current_reading(self, now: datetime | None = None) -> None: |
| 96 | + def store_current_reading(self, now: Optional[datetime] = None) -> None: |
97 | 97 | """Store current power measurement.""" |
98 | 98 | if now is None: |
99 | 99 | now = datetime.now() |
@@ -133,7 +133,7 @@ def __init__( |
133 | 133 | self, |
134 | 134 | client: MeshInterface, |
135 | 135 | dir_path: str, |
136 | | - power_logger: PowerLogger | None = None, |
| 136 | + power_logger: Optional[PowerLogger] = None, |
137 | 137 | include_raw=True, |
138 | 138 | ) -> None: |
139 | 139 | """Initialize the StructuredLogger object. |
|
0 commit comments