Misc. maintainability
In rough order of priority:
-
add a requirements.txt
in the TSE folder with a list of needed dependencies, version-locked -
move deployment variables to constants at the top of the file (serial path, room name, broker IP) -
make "ON" and "OFF" constants and use them in the code -
rename "controler" to "controller" -
don't mix '
and"
, pick one and stick with it -
add docstrings to all functions (except main) that explain what they do. for the conversion functions, include argument description (Shpinx format but without types, those should be annotated) -
move the main function and the __name__ = "__main__"
into its own file (main.py
or something) and pass parameters in (room, mqtt host, serial path) -
get serial path & mqtt host from env variables and serial path from CLI args