MarkGodwin / tplink-omada-api

MIT License
12 stars 9 forks source link

minor bug; fix order ssid,device to device,ssid for omada client output for Access point #48

Open FlyingToto opened 1 month ago

FlyingToto commented 1 month ago

would it be possible to make the order consistent between switches and access points in the output of the "omada clients"? the output of omada client seems to be: for physical switches: MAC, IP, Name, device, port
for AccessPoints: MAC, IP, Name, SSID, device

1) Could you please fix it such that it is consistent: for both: MAC, IP, Name, SSID/Port, device

2) As a rule of thumb, it might make sense to add a title header row with column names. This would make it easier to identify such issues and force standardization.

3) make the change backward compatible by versioning formated output and allow users to specific which version of output they want to use. In other words, running "omada clients" or "omada clients --version=1" will keep providing the same format as today. however running "omada clients --version=2" would return the fixed format with the headers row.
This provides also more flexibility to adapt the library in case tp-link introduces new formats later as well...

MarkGodwin commented 2 weeks ago

The CLI isn't really great for parsing the output, and I don't know that I want to commit to making CLI changes backward compatible going forwards. Really I would suggest using the API directly if you want to process information.

We could possibly add a command line option so it just prints out json data and no display formatting. Then you could pipe the output into a json parser of your choice?