|
发表于 2019-7-30 11:00:58
|
显示全部楼层
仔细去看了看这个turn_off 命令, S大的代码这个函数是直接调用了 https://github.com/rytilahti/pyt ... tioningcompanion.py
miio库 的 off 命令
(还不是很明白@command 在python的具体用户,但是从字面上看是命令的意思吧)
也就是说,直接通过miio协议发送红外代码给空调了,米家App状态不更新不应该啊。
这个是我这边的日志:
2019-07-30 10:07:51 DEBUG (MainThread) [custom_components.xiaomi_miio_airconditioningcompanion.climate] enter into async_turn_off() function
2019-07-30 10:07:51 DEBUG (SyncWorker_14) [miio.device] 192.168.144.151:54321 >>: {'id': 6922, 'method': 'set_power', 'params': ['off']}
2019-07-30 10:07:52 DEBUG (SyncWorker_14) [miio.device] 192.168.144.151:54321 (ts: 1970-01-02 13:15:53, id: 6922) << {'result': ['ok'], 'id': 6922}
2019-07-30 10:07:52 DEBUG (MainThread) [custom_components.xiaomi_miio_airconditioningcompanion.climate] Response received: ['ok']
[custom_components.xiaomi_miio_airconditioningcompanion.climate] Got new state: <AirConditioningCompanionStatus power=off, power_socket=None, load_power=7, air_condition_model=010500970001072701, model_format=1, device_type=5, air_condition_brand=151, air_condition_remote=67367, state_format=1, air_condition_configuration=01011B01, led=True, target_temperature=27, swing_mode=SwingMode.Off, fan_speed=FanSpeed.Low, mode=OperationMode.Cool>
|
|