HomeKit simulator: Adding human readable description to custom service characteristic

谁说我不能喝 提交于 2019-12-10 11:08:12

问题


I have added a custom characteristic to a service using the HomeKit Simulator. However when I add it, despite I include the manufactorer description, a UUID is shown instead of the description.

How can I display the description instead?

The first characteristic is a standard one ("On/Off": boolean). The other ones are custom.


回答1:


Until now the HomeKit Accessory Simulator (1.1) cannot be configured to show manufacturer description, as you want to.

At least in version 1.1 custom services can be attached and achieve a corresponding name, that the developer is able to distinguish. Characteristics can still not be named and remains a UUID mess. But as far as I know, this version (1.1) is only rolled out to MFi participants.




回答2:


You can add a manufacturer description to the characteristic.

Then after you add it will show like this

In your app, you can check first if there is a manufacturer description like this

let manufacturerDescription = characteristic.metadata?.manufacturerDescription


来源:https://stackoverflow.com/questions/29752463/homekit-simulator-adding-human-readable-description-to-custom-service-character

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!