ironware model: graceful handling of N-digit temps, addition of simulated ironware:ICX7150-48Z-HPOE (Ruckus) yaml#3457
Conversation
|
|
Please let me know if you require anything further from me to get this merged. Happy to help. Thanks. |
robertcheramy
left a comment
There was a problem hiding this comment.
Notes:
- If you provide a Device simulation file, it will be easier to test if the change works correctly.
- Don't worry about the
rubocop-sequel extension, this has to be fixed separately.
lib/oxidized/model/ironware.rb
Outdated
| cfg.gsub! /\d* deg C/, '' # Fix for ADX temperature reporting | ||
| cfg.gsub! /([\[]*)1([\]]*)<->([\[]*)2([\]]*)(<->([\[]*)3([\]]*))*/, '' | ||
| cfg.gsub! /\d{2}\.\d deg-C/, 'XX.X deg-C' | ||
| cfg.gsub! /1XX.X/, 'XX.X' |
There was a problem hiding this comment.
This could be better be solved by modifying the Line 40 and use \d+ or \d{2,3}
There was a problem hiding this comment.
Agreed. I originally had it like the latter and it upset something in the PR automated workflow related to linting. That's the only reason I submitted it this way in this attempt, but I've gone ahead and modified it once again as I agree it's better.
|
I've added the simulation yaml file and modified/reverted the regex to the more simplified/generalized solution. Let me know if there's anything else I can do, thanks. |
I had to create (fake) responses for the post_login and pre_logout commands in simulation.yaml.
robertcheramy
left a comment
There was a problem hiding this comment.
I've tuned the yaml simulation file because the post_login and pre_logout commands where missing and added a unit test.
If the "fake" answers in the simulation file are OK for you, I would merge this PR. If you want to change them to something more real, please do so, and I'll merge after it.
Note that these answers don't have an impact on the output of the model, so it is okay to leave them unchanged.
|
All seems good to me, thank you. |
Pre-Request Checklist
rubocop --auto-correct)rake test)Description
Add substitution for 3-digit temps to match 2-digit masking so as not to create unnecessary config commits when temps cross the 100 deg-C boundary in either direction between polls.