-
I made a command line script to check the battery levels on my cameras by modifying the examples.ts script. Once I got it all configured, it works great! It will even update the REFRESH_TOKEN automatically, so I don't have to get a token manually each time. The one final issue I have is that the script doesn't terminate. It logs the new token and spits out the battery data, but then just sits there. If I let it run for too long, it starts giving me memory leak warnings. I have tried calling process.exit(0), but that changed nothing. I tried changing the .subscribe call to .pipe(take(1))... and that changed nothing, although I did learn quite a bit about rxjs and Observables. Why does the script hang if I'm not actively monitoring anything? I just want to spit out the current battery levels and be done. YES, I know that the battery levels are in the app, but they're a pain in the wazuu to get all of them, and eventually, I would like to get all the data into a spreadsheet, so... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ok, so... |
Beta Was this translation helpful? Give feedback.
Ok, so...
The script quits now. I had to use both take(1) and process.exit(0).