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

Value data in android intent cannot be read #3824

Closed
Maaaciek1 opened this issue Aug 27, 2023 · 1 comment · Fixed by #3825
Closed

Value data in android intent cannot be read #3824

Maaaciek1 opened this issue Aug 27, 2023 · 1 comment · Fixed by #3825
Labels
bug Something isn't working sensor-tracking

Comments

@Maaaciek1
Copy link

Home Assistant Android app version(s): 2023.8.2

Android version(s): 10 QP1A.190711.020 MIUI Global 12.0.6

Device model(s): Xiaomi Redmi Note 8 Pro

Home Assistant version: 2023.8.4

Last working Home Assistant release (if known): ---

Description of problem: Notify for mi band app on Android used to send me value of my mi band battery, which I used as a sensor in Home Assistant. Since upgrading Companion app to 2023.8.2 (I'm not sure it is a cause, though) the sensor is unavailable. Value data in android intent is empty. Tasker can read the value data, so I assume that Notify for mi band app is correctly sending the intent. In attached logs you can see that key value is java.lang.Integer instead of expected String. Perhaps it is related to #3685?

Companion App Logs:

08-26 15:33:59.449  3416  3416 D SensorReceiver: Received intent: com.mc.miband.batteryStatGot
08-26 15:33:59.453  3416  3416 D LastUpdate: Last update is com.mc.miband.batteryStatGot
08-26 15:33:59.462  3416  3416 W Bundle  : Key value expected String but value was a java.lang.Integer.  The default value <null> was returned.
08-26 15:33:59.463  3416  3416 W Bundle  : Attempt to cast generated internal exception:
08-26 15:33:59.463  3416  3416 W Bundle  : java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
08-26 15:33:59.463  3416  3416 W Bundle  : 	at android.os.BaseBundle.getString(BaseBundle.java:1172)
08-26 15:33:59.463  3416  3416 W Bundle  : 	at io.homeassistant.companion.android.common.sensors.SensorReceiverBase.onReceive(SensorReceiverBase.kt:119)
08-26 15:33:59.463  3416  3416 W Bundle  : 	at io.homeassistant.companion.android.sensors.Hilt_SensorReceiver.onReceive(Hilt_SensorReceiver.java:26)
08-26 15:33:59.463  3416  3416 W Bundle  : 	at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1556)
08-26 15:33:59.463  3416  3416 W Bundle  : 	at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2)
08-26 15:33:59.463  3416  3416 W Bundle  : 	at android.os.Handler.handleCallback(Handler.java:914)
08-26 15:33:59.463  3416  3416 W Bundle  : 	at android.os.Handler.dispatchMessage(Handler.java:100)
08-26 15:33:59.463  3416  3416 W Bundle  : 	at android.os.Looper.loop(Looper.java:224)
08-26 15:33:59.463  3416  3416 W Bundle  : 	at android.app.ActivityThread.main(ActivityThread.java:7551)
08-26 15:33:59.463  3416  3416 W Bundle  : 	at java.lang.reflect.Method.invoke(Native Method)
08-26 15:33:59.463  3416  3416 W Bundle  : 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
08-26 15:33:59.463  3416  3416 W Bundle  : 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
08-26 15:33:59.463  3416  3416 D SensorReceiver: Event data: {value=, intent=com.mc.miband.batteryStatGot}

Screenshot or video of problem: 1

@Maaaciek1 Maaaciek1 added the bug Something isn't working label Aug 27, 2023
@dshokouhi
Copy link
Member

Perhaps it is related to #3685?

no seems like its related to #3698

Will do a partial revert as it seems the non-deprecated method won't work for us as we need to account for different types of values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sensor-tracking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants