From ddb2263a5e916c11cfcfe7d43475527082af09d3 Mon Sep 17 00:00:00 2001 From: boc-the-git <3479092+boc-the-git@users.noreply.github.com> Date: Wed, 13 Nov 2024 21:38:44 +1100 Subject: [PATCH] Fix comparison, replacing is with == --- src/PiicoDev_RFID.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PiicoDev_RFID.py b/src/PiicoDev_RFID.py index d44454f..9208873 100644 --- a/src/PiicoDev_RFID.py +++ b/src/PiicoDev_RFID.py @@ -69,7 +69,7 @@ def __init__(self, bus=None, freq=None, sda=None, scl=None, address=_I2C_ADDRESS self.i2c = create_unified_i2c(bus=bus, freq=freq, sda=sda, scl=scl) if type(asw) is list: # determine address from ASW switch positions (if provided) - assert max(asw) <= 1 and min(asw) >= 0 and len(asw) is 2, "asw must be a list of 1/0, length=2" + assert max(asw) <= 1 and min(asw) >= 0 and len(asw) == 2, "asw must be a list of 1/0, length=2" self.address=_I2C_ADDRESS+asw[0]+2*asw[1] else: self.address = address # fall back on using address argument