|
3 | 3 | # SPDX-License-Identifier: MIT |
4 | 4 |
|
5 | 5 | from pathlib import Path |
6 | | -from typing import Any, Optional |
| 6 | +from typing import Any, Optional, Union |
7 | 7 |
|
8 | 8 | from .__version__ import get_version |
9 | 9 | from .constants import DEFAULT_WS_URL |
@@ -193,7 +193,7 @@ async def serial_monitor_cat(self, decode_utf8: bool = True, errors: str = "repl |
193 | 193 | else: |
194 | 194 | print(line, end="", flush=True) |
195 | 195 |
|
196 | | - async def serial_write(self, data: bytes | str | list[int]) -> None: |
| 196 | + async def serial_write(self, data: Union[bytes, str, list[int]]) -> None: |
197 | 197 | """Write data to the simulation serial monitor interface.""" |
198 | 198 | await write_serial(self._transport, data) |
199 | 199 |
|
@@ -222,7 +222,9 @@ async def listen_pin(self, part: str, pin: str, listen: bool = True) -> Response |
222 | 222 | """ |
223 | 223 | return await pin_listen(self._transport, part=part, pin=pin, listen=listen) |
224 | 224 |
|
225 | | - async def set_control(self, part: str, control: str, value: int | bool | float) -> ResponseMessage: |
| 225 | + async def set_control( |
| 226 | + self, part: str, control: str, value: Union[int, bool, float] |
| 227 | + ) -> ResponseMessage: |
226 | 228 | """Set a control value (e.g. simulate button press). |
227 | 229 |
|
228 | 230 | Args: |
|
0 commit comments