Add duty cycle/utilization fields, wheel picker for goals, and updated screenshots
- Add dutyCyclePercent and defaultUtilizationFactorPercent to ComponentLibraryItem with normalization logic and backend field fetching - Change default dailyUsageHours from 1h to 24h - Replace goal editor stepper with day/hour/minute wheel pickers - Update app icon colors and remove duplicate icon assets - Move SavedBattery.swift into Batteries/ directory, remove Pods group - Add iPad-only flag and start frame support to screenshot framing scripts - Rework localized App Store screenshot titles across all languages - Add runtime goals and BOM completed items to sample data - Bump version to 1.5.1 (build 41) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,8 @@ struct ComponentLibraryItemTests {
|
||||
voltageIn: nil,
|
||||
voltageOut: nil,
|
||||
watt: nil,
|
||||
dutyCyclePercent: nil,
|
||||
defaultUtilizationFactorPercent: nil,
|
||||
iconURL: nil,
|
||||
affiliateLinks: []
|
||||
)
|
||||
@@ -28,6 +30,8 @@ struct ComponentLibraryItemTests {
|
||||
voltageIn: nil,
|
||||
voltageOut: nil,
|
||||
watt: nil,
|
||||
dutyCyclePercent: nil,
|
||||
defaultUtilizationFactorPercent: nil,
|
||||
iconURL: nil,
|
||||
affiliateLinks: []
|
||||
)
|
||||
@@ -47,6 +51,8 @@ struct ComponentLibraryItemTests {
|
||||
voltageIn: nil,
|
||||
voltageOut: nil,
|
||||
watt: nil,
|
||||
dutyCyclePercent: nil,
|
||||
defaultUtilizationFactorPercent: nil,
|
||||
iconURL: nil,
|
||||
affiliateLinks: []
|
||||
)
|
||||
@@ -63,6 +69,8 @@ struct ComponentLibraryItemTests {
|
||||
voltageIn: nil,
|
||||
voltageOut: nil,
|
||||
watt: nil,
|
||||
dutyCyclePercent: nil,
|
||||
defaultUtilizationFactorPercent: nil,
|
||||
iconURL: nil,
|
||||
affiliateLinks: []
|
||||
)
|
||||
@@ -79,6 +87,8 @@ struct ComponentLibraryItemTests {
|
||||
voltageIn: nil,
|
||||
voltageOut: nil,
|
||||
watt: nil,
|
||||
dutyCyclePercent: nil,
|
||||
defaultUtilizationFactorPercent: nil,
|
||||
iconURL: nil,
|
||||
affiliateLinks: []
|
||||
)
|
||||
@@ -95,6 +105,8 @@ struct ComponentLibraryItemTests {
|
||||
voltageIn: nil,
|
||||
voltageOut: nil,
|
||||
watt: nil,
|
||||
dutyCyclePercent: nil,
|
||||
defaultUtilizationFactorPercent: nil,
|
||||
iconURL: nil,
|
||||
affiliateLinks: []
|
||||
)
|
||||
@@ -102,4 +114,38 @@ struct ComponentLibraryItemTests {
|
||||
let french = Foundation.Locale(identifier: "fr_FR")
|
||||
#expect(item.localizedName(for: french) == "Guindeau")
|
||||
}
|
||||
|
||||
@Test func normalizedDutyCycleTreatsZeroAsFullUsage() async throws {
|
||||
let item = ComponentLibraryItem(
|
||||
id: "component-7",
|
||||
name: "Compressor",
|
||||
translations: [:],
|
||||
voltageIn: nil,
|
||||
voltageOut: nil,
|
||||
watt: nil,
|
||||
dutyCyclePercent: 0,
|
||||
defaultUtilizationFactorPercent: nil,
|
||||
iconURL: nil,
|
||||
affiliateLinks: []
|
||||
)
|
||||
|
||||
#expect(item.normalizedDutyCyclePercent == 100)
|
||||
}
|
||||
|
||||
@Test func defaultDailyUsageHoursConvertsPercentToHours() async throws {
|
||||
let item = ComponentLibraryItem(
|
||||
id: "component-8",
|
||||
name: "Heater",
|
||||
translations: [:],
|
||||
voltageIn: nil,
|
||||
voltageOut: nil,
|
||||
watt: nil,
|
||||
dutyCyclePercent: nil,
|
||||
defaultUtilizationFactorPercent: 50,
|
||||
iconURL: nil,
|
||||
affiliateLinks: []
|
||||
)
|
||||
|
||||
#expect(item.defaultDailyUsageHours == 12)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user