Battery indicators and other places no longer say "G2" when a G1 or iO is paired

This commit is contained in:
James Babcock committed 2026-11-07 22:56:31 -08:00
1 parent ac68ba5991
commit e103b89510
21 files changed
+101 -46

No files matched your search

+3 -3
View File
@@ -42,7 +42,7 @@ func padLine(state: PhoneState?, link: LinkStatus) -> StatusLine {
if !state.remoteEnabled { return StatusLine(text: "Watch control off", tone: .problem) }
if state.connected {
if state.charging || state.phase == "charging" {
return StatusLine(text: chargingLine(state.battery), tone: .busy, detail: caseLine(state))
return StatusLine(text: chargingLine(state), tone: .busy, detail: caseLine(state))
}
if state.silentMode { return StatusLine(text: "Silent mode", tone: .off) }
if state.locked { return StatusLine(text: "Locked", tone: .off) }
@@ -64,8 +64,8 @@ func padLine(state: PhoneState?, link: LinkStatus) -> StatusLine {
return StatusLine(text: "Disconnected", tone: .off)
}
private func chargingLine(_ battery: Int?) -> String {
battery.map { "Charging · G2 \($0)%" } ?? "Charging"
private func chargingLine(_ state: PhoneState) -> String {
state.battery.map { "Charging: \(state.glassesModel) \($0)%" } ?? "Charging"
}
/**
+4 -1
View File
@@ -103,8 +103,10 @@ struct PhoneState: Equatable {
var locked = false
var worn: Bool?
var listening = false
/** Current or last-known G2 charge percentage. */
/** The glasses' current or last-known charge percentage. */
var battery: Int?
/** The paired glasses' model, as the charging line names it. */
var glassesModel = "G2"
var charging = false
/** Last-known charging-case percentage; live only while the glasses are docked. */
var caseBattery: Int?
@@ -139,6 +141,7 @@ struct PhoneState: Equatable {
state.worn = o["worn"] as? Bool
state.listening = o["listening"] as? Bool ?? false
state.battery = percent(o["battery"])
state.glassesModel = o["glassesModel"] as? String ?? "G2"
state.charging = o["charging"] as? Bool ?? false
state.caseBattery = percent(o["caseBattery"])
state.caseCharging = o["caseCharging"] as? Bool