Skip to content

Commit 68eab73

Browse files
committed
__init__(): sleep only when creating new I2CDevice
1 parent 11db0b9 commit 68eab73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_pcf8563_timer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ class PCF8563_Timer: # pylint: disable=too-few-public-methods
105105
value False asserts INT permanently."""
106106

107107
def __init__(self, i2c: Union[I2C, I2CDevice]) -> None:
108-
time.sleep(0.05)
109108
if isinstance(i2c, I2CDevice):
110109
self.i2c_device = i2c # reuse i2c_device (from PCF8563-instance)
111110
else:
111+
time.sleep(0.05)
112112
self.i2c_device = I2CDevice(i2c, 0x51)

0 commit comments

Comments
 (0)