Update adafruit_ina228.py
Some checks failed
Build CI / test (push) Has been cancelled

This commit is contained in:
Liz 2025-01-28 18:10:37 -05:00
parent a2ac482336
commit 7ea93408d2

View file

@ -204,8 +204,12 @@ class INA228: # noqa: PLR0904
counts = [1, 4, 16, 64, 128, 256, 512, 1024] counts = [1, 4, 16, 64, 128, 256, 512, 1024]
if count not in counts: if count not in counts:
raise ValueError( raise ValueError(
f"Invalid averaging count: {count}. " "Invalid averaging count: "
f"Valid values are: {', '.join(map(str, counts))}." + str(count)
+ ". "
+ "Valid values are: "
+ ", ".join(map(str, counts))
+ "."
) )
self._avg_count = counts.index(count) self._avg_count = counts.index(count)