JurajNyiri / pytapo

Python library for communication with Tapo Cameras
MIT License
292 stars 60 forks source link

Add windows support for downloading recordings #54

Closed luskaner closed 1 year ago

luskaner commented 1 year ago

Hello:

This fixes #50 .

  1. The first commit changes the hardcoded /dev/null device to os.devnull which fixes redirection in Windows when saving the file.
  2. The second commit is a workaround for Windows, tempfile.NamedTemporaryFile works weird on Windows, when writing the contents, those are not flushed (even with flush()) so disabling the manually deleting of file and doing it manually works correctly (and should continue to work under other OS) - I also removed the close() call as using with that's unnecessary.
JurajNyiri commented 1 year ago

Thank you!