I've been developing this Air Quality / Health Impact Plugin for a while on and off. After updating from OctoPrint 1.4.0 to 1.4.2, I'm finding that, without a printer port set, OctoPrint is assuming that another serial port is the printer until it proves it isn't, which means my plugin can't build its list of serial sensors (I've made it ignore the printer port so it doesn't cause issues) on startup, and it doesn't return the port until later, so I'm currently needing to manually trigger a refresh of the sensor initialisation.
How can I solve this? Is there a way I can listen for when OctoPrint is done testing the serial ports to find a printer, and then do my sensor initialisation? Am I still using a sensible method to exclude the printer port? Is this going to change again over the next few releases?
self._printer.get_current_connection() is how I've been detecting the printer port in https://github.com/stantond/OctoPrint-AirQuality/blob/3d7fbd5c87806f5b6e010927e195cfc54fe61614/octoprint_airquality/SensorsManager.py#L89