What's your calibre, OS and Kindle firmware version?
I use this line of code to check if Kindle device is connected:
https://github.com/xxyzz/WordDumb/bl...d_file.py#L175
This should always works, unless calibre's driver uses a different value but that's unlikely.
I suspect calibre's Windows MTP driver code doesn't fill this value, this code works on Linux and mac.