Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Wear more details crash with Kelvin light temperature #3706

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

jpelgrom
Copy link
Member

Summary

Fixes the following crash I noticed while trying to view more details for a light on my watch. Looks like a merge conflict was resolved incorrectly in #3631 causing it to crash (the original PR #3477 had already changed it to %1$s).

2023-07-24 22:26:17.035  9557-9557  AndroidRuntime          io....stant.companion.android.debug  E  FATAL EXCEPTION: main
                                                                                                    Process: io.homeassistant.companion.android.debug, PID: 9557
                                                                                                    java.util.IllegalFormatConversionException: d != java.lang.String
                                                                                                    	at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4408)
                                                                                                    	at java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2890)
                                                                                                    	at java.util.Formatter$FormatSpecifier.print(Formatter.java:2844)
                                                                                                    	at java.util.Formatter.format(Formatter.java:2535)
                                                                                                    	at java.util.Formatter.format(Formatter.java:2464)
                                                                                                    	at java.lang.String.format(String.java:2911)
                                                                                                    	at android.content.res.Resources.getString(Resources.java:562)
                                                                                                    	at androidx.compose.ui.res.StringResources_androidKt.stringResource(StringResources.android.kt:49)
                                                                                                    	at io.homeassistant.companion.android.home.views.DetailsPanelViewKt.ColorTempSlider(DetailsPanelView.kt:306)
                                                                                                    	at io.homeassistant.companion.android.home.views.DetailsPanelViewKt$DetailsPanelView$1$3$1$4.invoke(DetailsPanelView.kt:134)
                                                                                                    	at io.homeassistant.companion.android.home.views.DetailsPanelViewKt$DetailsPanelView$1$3$1$4.invoke(DetailsPanelView.kt:133)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
                                                                                                    	at androidx.wear.compose.material.ScalingLazyColumnKt.ScalingLazyColumnItemWrapper(ScalingLazyColumn.kt:675)
                                                                                                    	at androidx.wear.compose.material.ScalingLazyColumnKt.access$ScalingLazyColumnItemWrapper(ScalingLazyColumn.kt:1)
                                                                                                    	at androidx.wear.compose.material.ScalingLazyListScopeImpl$item$1.invoke(ScalingLazyColumn.kt:612)
                                                                                                    	at androidx.wear.compose.material.ScalingLazyListScopeImpl$item$1.invoke(ScalingLazyColumn.kt:611)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
                                                                                                    	at androidx.compose.foundation.lazy.LazyListScopeImpl$item$3.invoke(LazyListScopeImpl.kt:56)
                                                                                                    	at androidx.compose.foundation.lazy.LazyListScopeImpl$item$3.invoke(LazyListScopeImpl.kt:56)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:135)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
                                                                                                    	at androidx.compose.foundation.lazy.LazyListItemProviderImpl$1$1.invoke(LazyListItemProvider.kt:89)
                                                                                                    	at androidx.compose.foundation.lazy.LazyListItemProviderImpl$1$1.invoke(LazyListItemProvider.kt:88)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
                                                                                                    	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
                                                                                                    	at androidx.compose.foundation.lazy.layout.LazyLayoutPinnableItemKt.LazyLayoutPinnableItem(LazyLayoutPinnableItem.kt:53)
                                                                                                    	at androidx.compose.foundation.lazy.LazyListItemProviderImpl$1.invoke(LazyListItemProvider.kt:84)
                                                                                                    	at androidx.compose.foundation.lazy.LazyListItemProviderImpl$1.invoke(LazyListItemProvider.kt:82)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:135)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
                                                                                                    	at androidx.compose.foundation.lazy.layout.DefaultLazyLayoutItemsProvider.Item(LazyLayoutItemProvider.kt:118)
                                                                                                    	at androidx.compose.foundation.lazy.LazyListItemProviderImpl.Item(Unknown Source:76)
                                                                                                    	at androidx.compose.foundation.lazy.layout.DefaultDelegatingLazyLayoutItemProvider.Item(LazyLayoutItemProvider.kt:196)
                                                                                                    	at androidx.compose.foundation.lazy.LazyListItemProviderKt$rememberLazyListItemProvider$1$1.Item(Unknown Source:27)
                                                                                                    	at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactory$CachedItemContent$createContentLambda$1$1.invoke(LazyLayoutItemContentFactory.kt:99)
                                                                                                    	at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactory$CachedItemContent$createContentLambda$1$1.invoke(LazyLayoutItemContentFactory.kt:98)
2023-07-24 22:26:17.040  9557-9557  AndroidRuntime          io....stant.companion.android.debug  E  	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
                                                                                                    	at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
                                                                                                    	at androidx.compose.runtime.saveable.SaveableStateHolderImpl.SaveableStateProvider(SaveableStateHolder.kt:84)
                                                                                                    	at androidx.compose.foundation.lazy.layout.LazySaveableStateHolder.SaveableStateProvider(LazySaveableStateHolder.kt:84)
                                                                                                    	at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactory$CachedItemContent$createContentLambda$1.invoke(LazyLayoutItemContentFactory.kt:98)
                                                                                                    	at androidx.compose.foundation.lazy.layout.LazyLayoutItemContentFactory$CachedItemContent$createContentLambda$1.invoke(LazyLayoutItemContentFactory.kt:90)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
                                                                                                    	at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$subcompose$3$1$1.invoke(SubcomposeLayout.kt:778)
                                                                                                    	at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$subcompose$3$1$1.invoke(SubcomposeLayout.kt:446)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
                                                                                                    	at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
                                                                                                    	at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:78)
                                                                                                    	at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3373)
                                                                                                    	at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3363)
                                                                                                    	at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
                                                                                                    	at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
                                                                                                    	at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3363)
                                                                                                    	at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3298)
                                                                                                    	at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:587)
                                                                                                    	at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:966)
                                                                                                    	at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:3973)
                                                                                                    	at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:3973)
                                                                                                    	at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:519)
                                                                                                    	at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcomposeInto(SubcomposeLayout.kt:466)
                                                                                                    	at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcompose(SubcomposeLayout.kt:439)
                                                                                                    	at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcompose(SubcomposeLayout.kt:430)
                                                                                                    	at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcompose(SubcomposeLayout.kt:419)
                                                                                                    	at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$Scope.subcompose(SubcomposeLayout.kt:740)
                                                                                                    	at androidx.compose.foundation.lazy.layout.LazyLayoutMeasureScopeImpl.measure-0kLqBqw(LazyLayoutMeasureScope.kt:118)
                                                                                                    	at androidx.compose.foundation.lazy.LazyMeasuredItemProvider.getAndMeasure-ZjPyQlc(LazyMeasuredItemProvider.kt:47)
                                                                                                    	at androidx.compose.foundation.lazy.LazyListMeasureKt.measureLazyList-Hh3qtAg(LazyListMeasure.kt:164)
                                                                                                    	at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1.invoke-0kLqBqw(LazyList.kt:299)
                                                                                                    	at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1.invoke(LazyList.kt:190)
                                                                                                    	at androidx.compose.foundation.lazy.layout.LazyLayoutKt$LazyLayout$1$2$1.invoke-0kLqBqw(LazyLayout.kt:71)
                                                                                                    	at androidx.compose.foundation.lazy.layout.LazyLayoutKt$LazyLayout$1$2$1.invoke(LazyLayout.kt:69)
                                                                                                    	at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$createMeasurePolicy$1.measure-3p2s80s(SubcomposeLayout.kt:598)
                                                                                                    	at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:103)
2023-07-24 22:26:17.044  9557-9557  AndroidRuntime          io....stant.companion.android.debug  E  	at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(GraphicsLayerModifier.kt:635)
                                                                                                    	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:155)
                                                                                                    	at androidx.wear.compose.material.ScalingLazyColumnKt$verticalNegativePadding$1.invoke-3p2s80s(ScalingLazyColumn.kt:728)
                                                                                                    	at androidx.wear.compose.material.ScalingLazyColumnKt$verticalNegativePadding$1.invoke(ScalingLazyColumn.kt:724)
                                                                                                    	at androidx.compose.ui.layout.LayoutModifierImpl.measure-3p2s80s(LayoutModifier.kt:294)
                                                                                                    	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:155)
                                                                                                    	at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(GraphicsLayerModifier.kt:635)
                                                                                                    	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:155)
                                                                                                    	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2.invoke(LayoutNodeLayoutDelegate.kt:1090)
                                                                                                    	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2.invoke(LayoutNodeLayoutDelegate.kt:1086)
                                                                                                    	at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
                                                                                                    	at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
                                                                                                    	at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
                                                                                                    	at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
                                                                                                    	at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
                                                                                                    	at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
                                                                                                    	at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
                                                                                                    	at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:107)
                                                                                                    	at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:1086)
                                                                                                    	at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:36)
                                                                                                    	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:342)
                                                                                                    	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.measure-BRTryo0(LayoutNodeLayoutDelegate.kt:321)
                                                                                                    	at androidx.compose.foundation.layout.BoxKt$boxMeasurePolicy$1.measure-3p2s80s(Box.kt:115)
                                                                                                    	at androidx.compose.foundation.layout.BoxWithConstraintsKt$BoxWithConstraints$1$1.invoke-0kLqBqw(BoxWithConstraints.kt:70)
                                                                                                    	at androidx.compose.foundation.layout.BoxWithConstraintsKt$BoxWithConstraints$1$1.invoke(BoxWithConstraints.kt:67)
                                                                                                    	at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$createMeasurePolicy$1.measure-3p2s80s(SubcomposeLayout.kt:598)
                                                                                                    	at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:103)
                                                                                                    	at androidx.compose.foundation.layout.FillModifier.measure-3p2s80s(Size.kt:658)
                                                                                                    	at androidx.compose.ui.node.BackwardsCompatNode.measure-3p2s80s(BackwardsCompatNode.kt:323)
                                                                                                    	at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:155)
                                                                                                    	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2.invoke(LayoutNodeLayoutDelegate.kt:1090)
                                                                                                    	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasure$2.invoke(LayoutNodeLayoutDelegate.kt:1086)
                                                                                                    	at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2200)
                                                                                                    	at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:234)
                                                                                                    	at androidx.compose.runtime.snapshots.SnapshotStateObserver$observeReads$1$1.invoke(SnapshotStateObserver.kt:230)
                                                                                                    	at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
2023-07-24 22:26:17.049  9557-9557  AndroidRuntime          io....stant.companion.android.debug  E  	at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
                                                                                                    	at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:230)
                                                                                                    	at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:120)
                                                                                                    	at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(OwnerSnapshotObserver.kt:107)
                                                                                                    	at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:1086)
                                                                                                    	at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:36)
                                                                                                    	at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(LayoutNodeLayoutDelegate.kt:342)
                                                                                                    	at androidx.compose.ui.node.LayoutNode.remeasure-_Sx5XlM$ui_release(LayoutNode.kt:1188)
                                                                                                    	at androidx.compose.ui.node.LayoutNode.remeasure-_Sx5XlM$ui_release$default(LayoutNode.kt:1179)
                                                                                                    	at androidx.compose.ui.node.MeasureAndLayoutDelegate.doRemeasure-sdFAvZA(MeasureAndLayoutDelegate.kt:309)
                                                                                                    	at androidx.compose.ui.node.MeasureAndLayoutDelegate.remeasureAndRelayoutIfNeeded(MeasureAndLayoutDelegate.kt:434)
                                                                                                    	at androidx.compose.ui.node.MeasureAndLayoutDelegate.access$remeasureAndRelayoutIfNeeded(MeasureAndLayoutDelegate.kt:39)
                                                                                                    	at androidx.compose.ui.node.MeasureAndLayoutDelegate.measureAndLayout(MeasureAndLayoutDelegate.kt:330)
                                                                                                    	at androidx.compose.ui.platform.AndroidComposeView.measureAndLayout(AndroidComposeView.android.kt:805)
                                                                                                    	at androidx.compose.ui.node.Owner.measureAndLayout$default(Owner.kt:221)
                                                                                                    	at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.android.kt:1035)
                                                                                                    	at android.view.View.draw(View.java:22938)
                                                                                                    	at android.view.View.updateDisplayListIfDirty(View.java:21803)
                                                                                                    	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4537)
                                                                                                    	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4509)
                                                                                                    	at android.view.View.updateDisplayListIfDirty(View.java:21757)
                                                                                                    	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4537)
                                                                                                    	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4509)
                                                                                                    	at android.view.View.updateDisplayListIfDirty(View.java:21757)
                                                                                                    	at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4537)
                                                                                                    	at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4509)
                                                                                                    	at android.view.View.updateDisplayListIfDirty(View.java:21757)
                                                                                                    	at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:559)
                                                                                                    	at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:565)
                                                                                                    	at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:642)
                                                                                                    	at android.view.ViewRootImpl.draw(ViewRootImpl.java:4298)
                                                                                                    	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4011)
                                                                                                    	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3259)
                                                                                                    	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2076)
                                                                                                    	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8615)
                                                                                                    	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:998)
                                                                                                    	at android.view.Choreographer.doCallbacks(Choreographer.java:796)
                                                                                                    	at android.view.Choreographer.doFrame(Choreographer.java:731)
                                                                                                    	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:983)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:938)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                    	at android.os.Looper.loop(Looper.java:246)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:7690)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)

Screenshots

n/a

Link to pull request in Documentation repository

n/a

Any other notes

Copy link
Member

@dshokouhi dshokouhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@JBassett JBassett enabled auto-merge (squash) July 24, 2023 20:39
@JBassett JBassett merged commit 6744b61 into home-assistant:master Jul 24, 2023
3 checks passed
@jpelgrom jpelgrom deleted the wear-slider-argument-float branch July 24, 2023 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants