【发布时间】:2016-02-20 13:38:56
【问题描述】:
我正在编写一个 Android 应用程序来控制 Nest 恒温器。我能够很好地连接到它,并且可以读取正确的目标温度(打开恒温器上的旋钮会更新我的 TextView)。
但是,当我尝试这样写目标温度时,什么也没有发生:
String thermostatID = mThermostat.getDeviceId();
mNest.thermostats.setTargetTemperatureF(thermostatID, 70);
我尝试先设置 HVAC 模式,以备不时之需,但这也不起作用:
String thermostatID = mThermostat.getDeviceId();
mNest.thermostats.setHVACMode(thermostatID, "cool");
mNest.thermostats.setTargetTemperatureF(thermostatID, 70);
Textview 闪烁 70 秒,但随后又回升至 77,这是实际恒温器设置的目标温度。这是setTargetTemperatureF 的 SDK 代码的问题,还是我在这里遗漏了一些简单的东西?
【问题讨论】: