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

账号接入问题 #33

Open
rangerzhou opened this issue May 17, 2019 · 1 comment
Open

账号接入问题 #33

rangerzhou opened this issue May 17, 2019 · 1 comment

Comments

@rangerzhou
Copy link

Hi TianHang,
我们想在车机娱乐系统上和米家的设备互动互通,想获取到米家设备的状态以发送命令给设备,据了解应该是通过这个mijiaSDK接入,测试阶段没有服务器,已申请企业组,在小米开放平台创建了应用(智能家庭服务权限申请被拒了,原因是该能力仅面向智能硬件已接入小米IOT平台的企业开放重新申请审核中),把demo的包名改成了创建应用的包名,同时替换了APPID和APPKEY,这样的话点击demo中的MIACCOUNTLOGIN button会遇到NumberFormatException的问题,应该是格式转换中传递参数的问题,异常log如下:

05-16 14:36:23.246 14116 14116 E AndroidRuntime: FATAL EXCEPTION: main
05-16 14:36:23.246 14116 14116 E AndroidRuntime: Process: com.aptiv.aptivdemo, PID: 14116
05-16 14:36:23.246 14116 14116 E AndroidRuntime: java.lang.NumberFormatException: null
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at java.lang.Long.parseLong(Long.java:557)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at java.lang.Long.valueOf(Long.java:808)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at com.mi.account.XiaomiAccountGetPeopleInfoTask.(XiaomiAccountGetPeopleInfoTask.java:38)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at com.mi.activity.main.AccountActivity.processAuthResult(AccountActivity.java:183)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at com.mi.activity.main.AccountActivity.access$200(AccountActivity.java:32)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at com.mi.activity.main.AccountActivity$3.onPostExecute(AccountActivity.java:155)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at android.os.AsyncTask.finish(AsyncTask.java:755)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at android.os.AsyncTask.access$900(AsyncTask.java:192)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:772)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at android.os.Looper.loop(Looper.java:214)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7116)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
05-16 14:36:23.246 14116 14116 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:925)

我账号下家里有一台 米家智能摄像机云台版,其实目的就是想和米家的设备互通,获取设备状态以及发送命令给设备,因为没有服务器,所以通过授权码授权模式是不是不可用?那账号接入中的回调地址也没发修改填写了。

1.这种情况只能用隐式授权模式吗?
2.获取设备列表是否和申请应用的家庭服务权限有关,还是只和登陆的账户有关?
3.能否获取米家官方的设备(电视,门锁,空调,扫地机器人等),还是只能控制企业自己的硬件?

呈请解惑,多谢!

mi.log

@M201370367
Copy link
Contributor

从堆栈中可以看到expiresIn为空引起。请问下accessToken有获取吗?
accessToken和其他账号认证信息可以从processAuthResult函数中获取。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants