Conversation
python.d/w1sensor.chart.py
Outdated
| 'absolute', 1, 10]) | ||
| self.definitions['temp']['lines'] = lines | ||
| return len(self.probes) > 0 | ||
| except Exception as error: |
There was a problem hiding this comment.
Some suggestions:
- Make
exceptionmore specific - Remove all code from
try/exceptblock which can not cause an exception
Like:
try:
filenames = os.listdir(W1_DIR)
except OSError as err: # i believe we only need OSError here, but i am not sure
self.error(err)
return None
...
...
python.d/w1sensor.chart.py
Outdated
| value = round(int(matched.group(1)) / 1000., 1) | ||
| value = int(value * 10) | ||
| data['w1sensor_temp_' + identifier] = value | ||
| except Exception as error: |
There was a problem hiding this comment.
please make exception more specific
|
@dspinellis thanks for the contribution 👍 |
|
Thanks! I pushed a commit addressing your comments. I can then squash the commits when the PR passes code review. |
python.d/w1sensor.chart.py
Outdated
| value = round(int(matched.group(1)) / 1000., 1) | ||
| value = int(value * 10) | ||
| data['w1sensor_temp_' + identifier] = value | ||
| except OSError as err: |
|
I squashed my commits following your approval of the changes. |
python.d/w1sensor.chart.py
Outdated
| # default module values (can be overridden per job in `config`) | ||
| update_every = 5 | ||
| priority = 60000 | ||
| retries = 60 |
There was a problem hiding this comment.
Unless I'm mistaken, you're using the same number of retries as the default, in which case this line can probably be removed.
There was a problem hiding this comment.
Yes, retries and priority can be removed since it is current default
There was a problem hiding this comment.
Thank you; I removed them.
Ferroin
left a comment
There was a problem hiding this comment.
Beyond the one codre comment I left (which isn't really critical), looks good to me.
|
@dspinellis please do a rebase |
Multiple 1-Wire temperature sensors are auto-detected and monitored. Displayed sensor names are user-configurable.
|
I rebased and squashed the commit to remove the unneeded default values. |
|
Well done! |
Auto-detect and display data from multiple 1-Wire temperature sensors.
Sensor names are user-configurable.