Environment
- smctl 0.1.8 (Homebrew), MacBook Pro (M5 Pro), macOS 26
Repro
A natural-looking custom curve in /etc/smctl/config.toml:
[[fan.curves]]
name = "test"
sensors = []
points = [[0, "max"], [105, "max"]]
hysteresis = 0
After sudo smctl daemon restart:
$ smctl fan profile test
Error: Fan profile 'test' is not configured.
The daemon log (os_log) shows the real cause:
Unable to parse /etc/smctl/config.toml: DecodingError.typeMismatch: expected value of type String.
Path: fan.curves[0].points[0][0]. Debug description: Cannot decode "String" from 0
and after fixing points, the same again for hysteresis:
DecodingError.keyNotFound: Key 'hysteresis' not found … A "Double" does not exist at "hysteresis" in the TOML table.
Writing every number as a float (0.0, 105.0, hysteresis = 0.0) works.
Cause
TOMLKit decodes strictly by TOML type: a TOML integer does not decode as Swift Double. FanPointValue.init(from:) tries Double → falls through to String → throws; hysteresis: Double similarly rejects integers.
Two suggestions
- Accept TOML integers wherever a Double is expected (try
Int in the decoders), since points = [[50, 2000]] is what everyone will write first.
- Surface the parse error to the user: today the daemon logs it and silently runs on defaults, and the CLI only says "profile not configured".
smctl daemon status showing last error: - while the config failed to parse is particularly misleading — a config parse failure should at least show up there.
Environment
Repro
A natural-looking custom curve in
/etc/smctl/config.toml:After
sudo smctl daemon restart:The daemon log (os_log) shows the real cause:
and after fixing points, the same again for
hysteresis:Writing every number as a float (
0.0,105.0,hysteresis = 0.0) works.Cause
TOMLKit decodes strictly by TOML type: a TOML integer does not decode as Swift
Double.FanPointValue.init(from:)triesDouble→ falls through toString→ throws;hysteresis: Doublesimilarly rejects integers.Two suggestions
Intin the decoders), sincepoints = [[50, 2000]]is what everyone will write first.smctl daemon statusshowinglast error: -while the config failed to parse is particularly misleading — a config parse failure should at least show up there.