Ambient lighting updates

This commit is contained in:
Garth Vander Houwen 2023-12-01 16:33:17 -08:00
parent d63daf5cf3
commit 7b77cfc3de
5 changed files with 28 additions and 19 deletions

View file

@ -54,24 +54,25 @@ struct AmbientLightingConfig: View {
.foregroundColor(.orange)
}
Section(header: Text("options")) {
VStack {
Toggle(isOn: $ledState) {
Label("LED State", systemImage: ledState ? "lightbulb.led.fill" : "lightbulb.led")
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
HStack {
Image(systemName: "eyedropper")
.foregroundColor(.accentColor)
ColorPicker("Color", selection: $color, supportsOpacity: false)
.padding(5)
}
HStack {
Image(systemName: "directcurrent")
.foregroundColor(.accentColor)
Stepper("Current: \(current)", value: $current, in: 0...31, step: 1)
.padding(5)
}
Toggle(isOn: $ledState) {
Label("LED State", systemImage: ledState ? "lightbulb.led.fill" : "lightbulb.led")
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
.listRowSeparator(.hidden)
Text("The state of the LED (on/off)")
.font(.caption)
.foregroundStyle(.gray)
HStack {
Image(systemName: "eyedropper")
.foregroundColor(.accentColor)
ColorPicker("Color", selection: $color, supportsOpacity: false)
.padding(5)
}
HStack {
Image(systemName: "directcurrent")
.foregroundColor(.accentColor)
Stepper("Current: \(current)", value: $current, in: 0...31, step: 1)
.padding(5)
}
.onChange(of: color, initial: true) {
components = color.resolve(in: environment)
@ -79,7 +80,7 @@ struct AmbientLightingConfig: View {
}
}
}
//.disabled(self.bleManager.connectedPeripheral == nil || node?.ambientLightingConfig == nil)
.disabled(self.bleManager.connectedPeripheral == nil || node?.ambientLightingConfig == nil)
Button {
isPresentingSaveConfirm = true
} label: {

View file

@ -12,6 +12,8 @@
"ago"="her";
"airtime"="Airtime";
"always.on"="Immer an";
"ambient.lighting"="Ambient Lighting";
"ambient.lighting.config"="Ambient Lighting Config";
"app.settings"="App Einstellungen";
"are.you.sure"="Bist Du sicher?";
"ascii.capable"="ASCII fähig";

View file

@ -12,6 +12,8 @@
"ago"="ago";
"airtime"="Airtime";
"always.on"="Always On";
"ambient.lighting"="Ambient Lighting";
"ambient.lighting.config"="Ambient Lighting Config";
"app.settings"="App Settings";
"are.you.sure"="Are you sure?";
"ascii.capable"="ASCII Capable";

View file

@ -14,6 +14,8 @@
"ago"="temu";
"airtime"="Czas nadawania";
"always.on"="Zawsze włączone";
"ambient.lighting"="Ambient Lighting";
"ambient.lighting.config"="Ambient Lighting Config";
"app.settings"="Ustawienia aplikacji";
"are.you.sure"="Jesteś pewny?";
"ascii.capable"="Zgodny z ASCII";

View file

@ -12,6 +12,8 @@
"ago"="ago";
"airtime"="广播时间";
"always.on"="常亮";
"ambient.lighting"="Ambient Lighting";
"ambient.lighting.config"="Ambient Lighting Config";
"app.settings"="通用设置";
"are.you.sure"="是否确认?";
"ascii.capable"="ASCII Capable";