@@ -242,38 +242,36 @@ def _set_config(
242
242
243
243
# Type/value check the parameters
244
244
if hyst_mode not in [HYST_00 , HYST_15 , HYST_30 , HYST_60 ]:
245
- raise ValueError (
246
- f"hyst_mode: { hyst_mode } . Value should be between 0 and 3 inclusive."
247
- )
248
- if shdn .__class__ != bool :
245
+ raise ValueError (f"hyst_mode: { hyst_mode } . Value should be between 0 and 3 inclusive." )
246
+ if shdn is not bool :
249
247
raise TypeError (
250
248
f"shdn: { shdn } { shdn .__class__ } . Expecting a bool." ,
251
249
)
252
- if crit_lock . __class__ != bool :
250
+ if crit_lock is not bool :
253
251
raise TypeError (
254
252
f"crit_lock: { crit_lock } { crit_lock .__class__ } . Expecting a bool." ,
255
253
)
256
- if alerts_lock . __class__ != bool :
254
+ if alerts_lock is not bool :
257
255
raise TypeError (
258
256
f"alerts_lock: { alerts_lock } { alerts_lock .__class__ } . Expecting a bool." ,
259
257
)
260
- if irq_clear_bit . __class__ != bool :
258
+ if irq_clear_bit is not bool :
261
259
raise TypeError (
262
260
f"irq_clear_bit: { irq_clear_bit } { irq_clear_bit .__class__ } . Expecting a bool." ,
263
261
)
264
- if alert_ctrl . __class__ != bool :
262
+ if alert_ctrl is not bool :
265
263
raise TypeError (
266
264
f"alert_ctrl: { alert_ctrl } { alert_ctrl .__class__ } . Expecting a bool." ,
267
265
)
268
- if alert_sel . __class__ != bool :
266
+ if alert_sel is not bool :
269
267
raise TypeError (
270
268
f"alert_sel: { alert_sel } { alert_sel .__class__ } . Expecting a bool." ,
271
269
)
272
- if alert_pol . __class__ != bool :
270
+ if alert_pol is not bool :
273
271
raise TypeError (
274
272
f"alert_pol: { alert_pol } { alert_pol .__class__ } . Expecting a bool." ,
275
273
)
276
- if alert_mode . __class__ != bool :
274
+ if alert_mode is not bool :
277
275
raise TypeError (
278
276
f"alert_mode: { alert_mode } { alert_mode .__class__ } . Expecting a bool." ,
279
277
)
@@ -308,9 +306,7 @@ def _set_config(
308
306
f"[WARN] Failed to set crit_lock. Set { crit_lock } got { self ._crit_lock } " ,
309
307
)
310
308
if self .irq_clear_bit :
311
- print (
312
- "[WARN] Something wrong with irq_clear_bit. Should always read False"
313
- )
309
+ print ("[WARN] Something wrong with irq_clear_bit. Should always read False" )
314
310
if self ._alerts_lock != alerts_lock :
315
311
print (
316
312
f"[WARN] Failed to set alerts_lock. Set { alerts_lock } got { self ._alerts_lock } " ,
@@ -626,9 +622,7 @@ def set_resolution(self, resolution=RES_0_0625) -> None:
626
622
if self ._debug :
627
623
check = self ._i2c .readfrom_mem (self ._addr , self .REG_RES , 1 )
628
624
if check != buf :
629
- print (
630
- f"[WARN] Failed to set resolution. Set { resolution } got { check [0 ]} "
631
- )
625
+ print (f"[WARN] Failed to set resolution. Set { resolution } got { check [0 ]} " )
632
626
633
627
@property
634
628
def hyst_mode (self ) -> int :
0 commit comments