python-panasonic-comfort-cloud icon indicating copy to clipboard operation
python-panasonic-comfort-cloud copied to clipboard

Have to get_devices before get_device

Open majurgens opened this issue 2 years ago • 2 comments

In the example code from the "module ussage" in the readme the flow is 3 basic steps

  1. get session
  2. get all devices
  3. get info about one device

Step 3 uses the device id (eg abcdefg) from Step 2

I assumed that if I already knew the device id eg abcdefg, then I could skip Step 2 and just go straight to Step 3. This proves to be incorrect.

For some reason, you have to list the devices (Step 2) before getting the info from a device, even if you make exactly the same call with exactly the same parameter values at Step 3.

I was hoping that I could skip Step 2 to speed up the process.

Any ideas why Step 2 seems to be required?

majurgens avatar Nov 28 '22 10:11 majurgens

the device id in the CLI command is just a reference to a long device guid in the panasonic API. Guess we could use that in the CLI command by updating this library.

lostfields avatar Sep 17 '23 11:09 lostfields

I guess what I am really trying to do is speed up the commands. For me a command to query a single device takes around 2 seconds. After digging further, this is made up of about 0.5 sec for the login session and then 1.5 seconds for the device query. Looking at this in a packet capture this is mostly waiting for the panasonic cloud to respond.

So perhaps there is actually nothing that we can do since it looks like the panasonic cloud is the slow part

majurgens avatar Sep 18 '23 01:09 majurgens