My driver take push message from device every 10 seconds, and at that time, there is a problem with UI(Mode
and Fan osillation
). Please see the linked video 0:07, 0:17.
There are two problems:
-
supportedAcModes
repeat appearing and disappearing -
supportedFanOscillationModes
does not show anything.
The first one happen during refresh function, like:
local SUPPORTED_AC_MODES = { "cool", "dry", "fanOnly", "auto", "heat" }
local SUPPORTED_FAN_OSCILLATION_MODES = { "fixed", "vertical", "horizontal", "all" }
...
function acm.hooks.refresh(driver, device, registers)
...
device:emit_event(capabilities.airConditionerMode.airConditionerMode(ac_mode))
device:emit_event(capabilities.airConditionerMode.supportedAcModes(SUPPORTED_AC_MODES))
device:emit_event(capabilities.fanOscillationMode.fanOscillationMode(swing_mode))
device:emit_event(capabilities.fanOscillationMode.supportedFanOscillationModes(SUPPORTED_FAN_OSCILLATION_MODES))
...
end
And log is:
...
emitting event: {"component_id":"main","attribute_id":"airConditionerMode","state":{"value":"heat"},"capability_id":"airConditionerMode"}
emitting event: {"component_id":"main","attribute_id":"supportedAcModes","state":{"value":["cool","dry","fanOnly","auto","heat"]},"capability_id":"airConditionerMode"}
emitting event: {"component_id":"main","attribute_id":"fanOscillationMode","state":{"value":"horizontal"},"capability_id":"fanOscillationMode"}
emitting event: {"component_id":"main","attribute_id":"supportedFanOscillationModes","state":{"value":["fixed","vertical","horizontal","all"]},"capability_id":"fanOscillationMode"}
...
I guess this problem is caused by emiting event airConditionerMode
and fanOscillationMode
, which clear supportedAcModes
and supportedFanOscillationModes
.
And second one, I have no idea, but I’ve just found out it can shown until next refresh if I turns app to backgrounds, and bring foreground(As you can see linked video, 0:20~).