mjg59 / python-broadlink

Python module for controlling Broadlink RM2/3 (Pro) remote controls, A1 sensor platforms and SP2/3 smartplugs
MIT License
1.35k stars 477 forks source link

broadlink_cli: Error/Status messages should go to stderr #744

Open bengtmartensson opened 1 year ago

bengtmartensson commented 1 year ago

It is common programming to write produced data to stdout while error and status messags go to stderr. That way, stdout can be used directly: for example redirecting to a file, or piped to another program. For example, to "learn" an IR signal and decode it on the fly,

./broadlink_cli --device @device --learn --durations | irptransmogrifier decode --input -

Presently, there are several commands like print("Learning...") that soil the output.

Suggestion: change to writing on stderr. (That would also make the --learnfile option (more or less) superflous).

felipediel commented 1 year ago

I think it's a good idea.