Allow raw-command and wifi without update (#688)

* Allow raw-command and wifi without update

* Call update always but on wifi&raw-command

* Add tests

* Skip update also if device_family was defined, as device factory performs an update
This commit is contained in:
Teemu R
2024-01-23 22:58:57 +01:00
committed by GitHub
parent f045696ebe
commit e576fcdb46
2 changed files with 36 additions and 3 deletions

View File

@@ -317,7 +317,6 @@ async def cli(
if type is not None:
dev = TYPE_TO_CLASS[type](host)
await dev.update()
elif device_family and encrypt_type:
ctype = ConnectionType(
DeviceFamilyType(device_family),
@@ -339,6 +338,9 @@ async def cli(
port=port,
credentials=credentials,
)
# Skip update for wifi & raw-command, and if factory was used to connect
if ctx.invoked_subcommand not in ["wifi", "raw-command"] and not device_family:
await dev.update()
ctx.obj = dev