Skip to content

Commit

Permalink
Fix use of "2 / 3" gain setting for ADS1x15 (#313)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slevin22 authored Jun 23, 2023
1 parent 23f7b74 commit 7367dd1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mqtt_io/modules/sensor/ads1x15.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
),
"pins": dict(type="list", required=True, empty=False, allowed=[0, 1, 2, 3]),
"gain": dict(
type="integer",
required=False,
empty=False,
allowed=[2 / 3, 1, 2, 4, 8, 16],
allowed=[0.6666666666666666, 1, 2, 4, 8, 16],
default=1,
),
}
Expand Down

0 comments on commit 7367dd1

Please sign in to comment.