Skip to content

Commit 7367dd1

Browse files
authored
Fix use of "2 / 3" gain setting for ADS1x15 (#313)
Currently, if "2 / 3" is entered into the config file for gain, it will error out as it requires an integer. In order to use this gain setting, we have to pass a float of 0.6666666666666666 to the adafruit library.
1 parent 23f7b74 commit 7367dd1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: mqtt_io/modules/sensor/ads1x15.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@
2121
),
2222
"pins": dict(type="list", required=True, empty=False, allowed=[0, 1, 2, 3]),
2323
"gain": dict(
24-
type="integer",
2524
required=False,
2625
empty=False,
27-
allowed=[2 / 3, 1, 2, 4, 8, 16],
26+
allowed=[0.6666666666666666, 1, 2, 4, 8, 16],
2827
default=1,
2928
),
3029
}

0 commit comments

Comments
 (0)