Out of range values from some pumps
elupus opened this issue · 3 comments
Seems some pumps have really weird out of range values. See home-assistant/core#100852 (comment) these cause reading to throw exceptions.
I'm pondering if we should demote range checks for decode to only log warnings, or even just log debug messages. We can still validate on write.
If you read a single coil then ReadException
is what you expect on failure. When a full table is read then, I think, it just logs a warning.
Well, its not like the max/min have a real affect on things. We can still represent the value. So getting the out of range value (on read) might be more useful, given the rather poor quality of the databases of parameters.
Raising on write does make sense, to not confuse the pump.
I've seen invalid temperature readings previously. My MAX485 module is not that good because I see some mess on the line. After adding pull up registers oscilloscope started to display a better picture but far from perfect.. I do get read errors quite frequently. I was thinking that in the read response packet checksum somehow managed to be correct but readings were off (1000 degrees or above).
Also during a reboot you can get out of range values quite easily. Maybe we fixed it with
def _is_hitting_integer_limit(self, coil: Coil, int_value: int):
I'd better keep range checks to keep these two issues away.