Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

外挂温湿度传感器时当前温度永远为整数 #100

Open
JackTonyMa opened this issue Jul 8, 2023 · 0 comments
Open

外挂温湿度传感器时当前温度永远为整数 #100

JackTonyMa opened this issue Jul 8, 2023 · 0 comments

Comments

@JackTonyMa
Copy link

米家的空调伴侣,子设备是aqara的温湿度传感器,发现homekit中温度永远是整数,研究了下代码发现是CurrentTemperature的minStep设置为1;
正好手上还有原生homekit的设备aqara空调伴侣p3,它也是外挂温湿度传感器的方式获取环境温度,在homekit中温度显示的最小单位是0.5,总结了下逻辑是将实际温度四舍五入为0.5的倍数,示例如下(左为aqara app显示的数值,右侧为homekti中显示的数值)
27.1->27.0;
27.3->27.5;
27.6->27.5;
27.75-28.0;
我以上述逻辑对安装好的插件的代码进行了修改,附上修改片段,目前测试下来工作正常
image

image
是否可以采纳这个建议

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

No branches or pull requests

1 participant