Skip to content

Commit c705085

Browse files
committed
apds9960: Address Copilot review on device_id PR.
1 parent b1705b6 commit c705085

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

lib/apds9960/apds9960/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def __init__(self, i2c, address=APDS9960_I2C_ADDR, valid_id=APDS9960_DEV_ID):
8080
self.set_gesture_int_enable(APDS9960_DEFAULT_GIEN)
8181

8282
def device_id(self):
83-
return self._read_reg(APDS9960_REG_ID)
83+
return self.dev_id
8484

8585
def get_mode(self):
8686
return self._read_reg(APDS9960_REG_ENABLE)

tests/scenarios/apds9960.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ tests:
5555
expect: 0xAB
5656
mode: [mock]
5757

58+
- name: "Read device ID via method"
59+
action: call
60+
method: device_id
61+
expect: 0xAB
62+
mode: [mock]
63+
5864
- name: "Verify device ID register (hardware)"
5965
action: read_register
6066
register: 0x92

0 commit comments

Comments
 (0)