mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-11-15 06:38:42 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user