|
4 | 4 |
|
5 | 5 | import click |
6 | 6 |
|
7 | | -from .click_common import command, format_output, EnumType |
| 7 | +from .click_common import command, format_output, EnumType, HexStringParamType |
8 | 8 | from .device import Device, DeviceException |
9 | 9 |
|
10 | 10 | _LOGGER = logging.getLogger(__name__) |
@@ -310,8 +310,8 @@ def learn_stop(self, slot: int=STORAGE_SLOT_ID): |
310 | 310 | return self.send("end_ir_learn", [slot]) |
311 | 311 |
|
312 | 312 | @command( |
313 | | - click.argument("model", type=bytes), |
314 | | - click.argument("code", type=bytes), |
| 313 | + click.argument("model", type=HexStringParamType), |
| 314 | + click.argument("code", type=HexStringParamType), |
315 | 315 | default_output=format_output("Sending the supplied infrared command") |
316 | 316 | ) |
317 | 317 | def send_ir_code(self, model: bytes, code: bytes, slot: int=0): |
@@ -346,7 +346,7 @@ def send_command(self, command: str): |
346 | 346 | return self.send("send_cmd", [str(command)]) |
347 | 347 |
|
348 | 348 | @command( |
349 | | - click.argument("model", type=str), |
| 349 | + click.argument("model", type=HexStringParamType), |
350 | 350 | click.argument("power", type=EnumType(Power, False)), |
351 | 351 | click.argument("operation_mode", type=EnumType(OperationMode, False)), |
352 | 352 | click.argument("target_temperature", type=int), |
|
0 commit comments