markwal / OctoPrint-PortLister

An OctoPrint plugin that notices when a new serial port appears and refreshes the port list without a page refresh
GNU Affero General Public License v3.0
26 stars 10 forks source link

Handle the baudrate NoneType case as "0/AUTO" #12

Closed FisheyLP closed 4 years ago

FisheyLP commented 5 years ago

Fixes #11

saschaludwig commented 4 years ago

please merge

markwal commented 4 years ago

I think maybe I accidentally fixed this with my Python 3 compatibility update. The main issue seemed to be the log line was passing None for a int which '%' didn't like. Your change updated it to be %s. Similarly I changed it to untyped placeholders using str.format.

I didn't make similar changes for baudrate like port. port has a "discovered" port and the auto connect set port "autoport" that have to be compared so that we don't try to auto connect to a port that appears, but doesn't match what the auto connect settings say. Baudrate doesn't have the same need since we're just passing the baudrate to the connection request and don't compare it ahead of time.

In any case, it appears to work. Thanks for the pull request. Sorry I've been away for so long.