diff --git a/Modules/Sensors/settings.swift b/Modules/Sensors/settings.swift index d8f611a2..55a4d11d 100644 --- a/Modules/Sensors/settings.swift +++ b/Modules/Sensors/settings.swift @@ -120,10 +120,12 @@ internal class Settings: NSStackView, Settings_v { } groups.forEach { (group: SensorGroup) in filtered.filter{ $0.group == group }.forEach { (s: Sensor_p) in - section.add(PreferencesRow(localizedString(s.name), component: switchView( + let btn = switchView( action: #selector(self.toggleSensor), state: s.state - ))) + ) + btn.identifier = NSUserInterfaceItemIdentifier(rawValue: s.key) + section.add(PreferencesRow(localizedString(s.name), component: btn)) } }