mirror of
https://github.com/RichieCahill/dotfiles.git
synced 2026-04-17 04:58:19 -04:00
fix treefmt issues
This commit is contained in:
@@ -20,6 +20,7 @@ class HeaterController:
|
||||
"""Controls a Tuya heater device via local network."""
|
||||
|
||||
def __init__(self, config: DeviceConfig) -> None:
|
||||
"""Initialize the controller."""
|
||||
self.device = tinytuya.Device(config.device_id, config.ip, config.local_key)
|
||||
self.device.set_version(config.version)
|
||||
self.device.set_socketTimeout(0.5)
|
||||
@@ -45,7 +46,7 @@ class HeaterController:
|
||||
def turn_on(self) -> ActionResult:
|
||||
"""Turn heater on."""
|
||||
try:
|
||||
self.device.set_value(DPS_POWER, True)
|
||||
self.device.set_value(index=DPS_POWER, value=True)
|
||||
return ActionResult(success=True, action="on", power=True)
|
||||
except Exception as error:
|
||||
logger.exception("Failed to turn on")
|
||||
@@ -54,7 +55,7 @@ class HeaterController:
|
||||
def turn_off(self) -> ActionResult:
|
||||
"""Turn heater off."""
|
||||
try:
|
||||
self.device.set_value(DPS_POWER, False)
|
||||
self.device.set_value(index=DPS_POWER, value=False)
|
||||
return ActionResult(success=True, action="off", power=False)
|
||||
except Exception as error:
|
||||
logger.exception("Failed to turn off")
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
environment = {
|
||||
PYTHONPATH = "${inputs.self}/";
|
||||
};
|
||||
environment = {
|
||||
PYTHONPATH = "${inputs.self}/";
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
|
||||
Reference in New Issue
Block a user