Skip to content

Commit 79106a2

Browse files
committed
apds9960: fix APSD/ADPS typos in constant and exception names.
Closes #14
1 parent a1f09cb commit 79106a2

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/apds9960/apds9960/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
APDS9960_BIT_AEN = 0b00000010
6969
APDS9960_BIT_PEN = 0b00000100
7070
APDS9960_BIT_WEN = 0b00001000
71-
APSD9960_BIT_AIEN = 0b00010000
71+
APDS9960_BIT_AIEN = 0b00010000
7272
APDS9960_BIT_PIEN = 0b00100000
7373
APDS9960_BIT_GEN = 0b01000000
7474
APDS9960_BIT_GVALID = 0b00000001

lib/apds9960/apds9960/device.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, bus, address=APDS9960_I2C_ADDR, valid_id=APDS9960_DEV_ID):
3939
# check device id
4040
self.dev_id = self._read_byte_data(APDS9960_REG_ID)
4141
if self.dev_id not in valid_id:
42-
raise ADPS9960InvalidDevId(self.dev_id, valid_id)
42+
raise APDS9960InvalidDevId(self.dev_id, valid_id)
4343

4444
# disable all features
4545
self.setMode(APDS9960_MODE_ALL, False)
@@ -87,7 +87,7 @@ def setMode(self, mode, enable=True):
8787
reg_val = self.getMode()
8888

8989
if mode < 0 or mode > APDS9960_MODE_ALL:
90-
raise ADPS9960InvalidMode(mode)
90+
raise APDS9960InvalidMode(mode)
9191

9292
# change bit(s) in ENABLE register */
9393
if mode == APDS9960_MODE_ALL:
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
class ADPS9960InvalidDevId(ValueError):
1+
class APDS9960InvalidDevId(ValueError):
22
def __init__(self, id, valid_ids):
33
Exception.__init__(
44
self,
5-
"Device id 0x{} is not a valied one (valid: {})!".format(
5+
"Device id 0x{} is not a valid one (valid: {})!".format(
66
format(id, "02x"),
77
", ".join(["0x{}".format(format(i, "02x")) for i in valid_ids]),
88
),
99
)
1010

1111

12-
class ADPS9960InvalidMode(ValueError):
12+
class APDS9960InvalidMode(ValueError):
1313
def __init__(self, mode):
1414
Exception.__init__(self, "Feature mode {} is invalid!".format(mode))

0 commit comments

Comments
 (0)