benleb / surepy

🐾 Library & CLI to monitor and control the Pet Door & Cat Flap Connect 🚪 the Pet Feeder Connect 🍽 and the Felaqua 💦 sold by Sure Petcare
https://pypi.org/project/surepy/
MIT License
78 stars 38 forks source link

'devices' command in CLI only reports one item on 0.5.0, reported all devices on 0.4.0 #11

Closed cs12ag closed 3 years ago

cs12ag commented 3 years ago

Not a priority issue, but there might be an problem with the 'devices' command in the CLI on 0.5.0. Here is the output from 0.5.0:

bash-5.0# surepy devices
         ╷           ╷                  ╷          ╷
      ID │ Household │ Name             │ Type     │ Serial
╶────────┼───────────┼──────────────────┼──────────┼────────╴
  nnnnnn │     nnnnn │ Backdoor Catflap │ Pet Flap │ None
         ╵           ╵                  ╵          ╵

and here is the output from 0.4.0:

bash-5.0# surepy devices

 surepy 🐾 v0.4.0

                            · Devices ·
         ╷           ╷          ╷                  ╷
      ID │ Household │ Type     │ Name             │       Serial
╶──────────────────────────────────────────────────────────────────
   nnnnn │     nnnnn │ Hub      │ Benbie's Hub     │ H002-nnnnnnn
  nnnnnn │     nnnnn │ Pet Flap │ Backdoor Catflap │            -
  nnnnnn │     nnnnn │ Feeder   │ Zamira’s Feeder  │ U003-nnnnnnn
  nnnnnn │     nnnnn │ Feeder   │ Benbie’s Feeder  │ U003-nnnnnnn
         ╵           ╵          ╵                  ╵

I do not have any Python knowledge, but I note there have been changes to the 'devices' command in the cli.py file recently. It would appear that the list of devices returned by SurePetcare() isn't being looped through correctly.

benleb commented 3 years ago

thanks! will check this

jonootto commented 3 years ago

Similar issue here, can only see the one flap, not the feeder or hub.

benleb commented 3 years ago

If you want, you can check out the dev branch :) If not, i plan to release the new (fixed) version next weekend :)

benleb commented 3 years ago

should be fixed in 0.6.0

if not, tell me :)