drivers/sensor/mcp9808: Ruff formatting.

Signed-off-by: MarcoMiano <58668074+MarcoMiano@users.noreply.github.com>
pull/958/head
MarcoMiano 2025-01-01 21:20:08 +01:00
rodzic 0d2e56c7e8
commit 233ec2987a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 78EE07F4B43E3FCC
1 zmienionych plików z 11 dodań i 17 usunięć

Wyświetl plik

@ -242,38 +242,36 @@ class MCP9808(object):
# Type/value check the parameters
if hyst_mode not in [HYST_00, HYST_15, HYST_30, HYST_60]:
raise ValueError(
f"hyst_mode: {hyst_mode}. Value should be between 0 and 3 inclusive."
)
if shdn.__class__ != bool:
raise ValueError(f"hyst_mode: {hyst_mode}. Value should be between 0 and 3 inclusive.")
if shdn is not bool:
raise TypeError(
f"shdn: {shdn} {shdn.__class__}. Expecting a bool.",
)
if crit_lock.__class__ != bool:
if crit_lock is not bool:
raise TypeError(
f"crit_lock: {crit_lock} {crit_lock.__class__}. Expecting a bool.",
)
if alerts_lock.__class__ != bool:
if alerts_lock is not bool:
raise TypeError(
f"alerts_lock: {alerts_lock} {alerts_lock.__class__}. Expecting a bool.",
)
if irq_clear_bit.__class__ != bool:
if irq_clear_bit is not bool:
raise TypeError(
f"irq_clear_bit: {irq_clear_bit} {irq_clear_bit.__class__}. Expecting a bool.",
)
if alert_ctrl.__class__ != bool:
if alert_ctrl is not bool:
raise TypeError(
f"alert_ctrl: {alert_ctrl} {alert_ctrl.__class__}. Expecting a bool.",
)
if alert_sel.__class__ != bool:
if alert_sel is not bool:
raise TypeError(
f"alert_sel: {alert_sel} {alert_sel.__class__}. Expecting a bool.",
)
if alert_pol.__class__ != bool:
if alert_pol is not bool:
raise TypeError(
f"alert_pol: {alert_pol} {alert_pol.__class__}. Expecting a bool.",
)
if alert_mode.__class__ != bool:
if alert_mode is not bool:
raise TypeError(
f"alert_mode: {alert_mode} {alert_mode.__class__}. Expecting a bool.",
)
@ -308,9 +306,7 @@ class MCP9808(object):
f"[WARN] Failed to set crit_lock. Set {crit_lock} got {self._crit_lock}",
)
if self.irq_clear_bit:
print(
"[WARN] Something wrong with irq_clear_bit. Should always read False"
)
print("[WARN] Something wrong with irq_clear_bit. Should always read False")
if self._alerts_lock != alerts_lock:
print(
f"[WARN] Failed to set alerts_lock. Set {alerts_lock} got {self._alerts_lock}",
@ -626,9 +622,7 @@ class MCP9808(object):
if self._debug:
check = self._i2c.readfrom_mem(self._addr, self.REG_RES, 1)
if check != buf:
print(
f"[WARN] Failed to set resolution. Set {resolution} got {check[0]}"
)
print(f"[WARN] Failed to set resolution. Set {resolution} got {check[0]}")
@property
def hyst_mode(self) -> int: