From ecf308d4ed74672e8a31ead3d65c8ba84ab6c080 Mon Sep 17 00:00:00 2001 From: Charles Butler Date: Tue, 15 Dec 2020 14:08:07 -0600 Subject: [PATCH] Add support for writing fan speed_percent (#109) --- pkg/devices/fan.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/devices/fan.go b/pkg/devices/fan.go index 6bc53d0..d8c40cf 100644 --- a/pkg/devices/fan.go +++ b/pkg/devices/fan.go @@ -83,7 +83,7 @@ func fanWrite(device *sdk.Device, data *sdk.WriteData) error { emitter := utils.GetEmitter(device.GetID()) switch data.Action { - case "speed": + case "speed", "speed_percent": emitter.Set(v) default: return fmt.Errorf("unsupport write action: %v", data.Action) @@ -105,7 +105,7 @@ func fanMultiWrite(device *sdk.Device, data *sdk.WriteData) error { emitter := utils.GetEmitter(device.GetID()) switch data.Action { - case "speed": + case "speed", "speed_percent": emitter.Set(v) default: return fmt.Errorf("unsupport write action: %v", data.Action)