Closed pjtait closed 5 years ago
That's odd because I thought I was supporting id, name and status parsing
See https://github.com/scls19fr/APC/blob/master/tests/test_outlet.py
Anyway contributions are welcome (with unit test and respecting PEP8)
Please use triple backquote for code in Github issues
Please use triple backticks for code in Github issues https://help.github.com/articles/creating-and-highlighting-code-blocks/
(Thanks for the guidance on code snippets.)
Looking at line 68 of outlet.py
, it seems that a line returned from the PDU is failing to match:
APC_OUTLET_ROW_PATTERN = re.compile('Outlet (\d) (.*) (OFF\*?|ON\*?)')
Looking at the output from an interactive telnet session, I see lines like:
5- Outlet 5 OFF
6- Focus Drive PS ON
so I think the pattern does not handle the case where a custom name has been applied to the outlet, it always expects to see "Outlet N
" in the line.
I'll see if I can contribute a fix.
I see that the regex pattern assumes the name/number field is numeric.