Skip to content

Commit

Permalink
Update Open page widget items limit and sensor capitalized state
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoncal committed Dec 16, 2024
1 parent 51c7ffd commit f4adda1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Sources/App/Resources/Base.lproj/Intents.intentdefinition
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>INIntentDefinitionNamespace</key>
<string>sI7YSe</string>
<key>INIntentDefinitionSystemVersion</key>
<string>24C5089c</string>
<string>24C101</string>
<key>INIntentDefinitionToolsBuildVersion</key>
<string>16B40</string>
<key>INIntentDefinitionToolsVersion</key>
Expand Down Expand Up @@ -1730,19 +1730,19 @@
<array>
<dict>
<key>INIntentParameterArraySizeSize</key>
<integer>2</integer>
<integer>3</integer>
<key>INIntentParameterArraySizeSizeClass</key>
<string>Small</string>
</dict>
<dict>
<key>INIntentParameterArraySizeSize</key>
<integer>4</integer>
<integer>6</integer>
<key>INIntentParameterArraySizeSizeClass</key>
<string>Medium</string>
</dict>
<dict>
<key>INIntentParameterArraySizeSize</key>
<integer>10</integer>
<integer>12</integer>
<key>INIntentParameterArraySizeSizeClass</key>
<string>Large</string>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ struct WidgetSensorsAppIntentTimelineProvider: AppIntentTimelineProvider {
stateValue: stateValue
)
let unitOfMeasurement = (state?["attributes"] as? [String: Any])?["unit_of_measurement"] as? String

stateValue = capitalizeFirstLetter(stateValue)
return WidgetSensorsEntry.SensorData(
id: sensor.id,
key: sensor.displayString,
Expand All @@ -140,6 +140,10 @@ struct WidgetSensorsAppIntentTimelineProvider: AppIntentTimelineProvider {
)
}

private func capitalizeFirstLetter(_ text: String) -> String {
text.prefix(1).uppercased() + text.dropFirst()
}

private func adjustPrecision(serverId: String, entityId: String, stateValue: String) -> String {
guard let stateValueFloat = Float(stateValue) else {
return stateValue
Expand Down

0 comments on commit f4adda1

Please sign in to comment.