fix aircon_gateway
This commit is contained in:
parent
c405ba7d6d
commit
9fd9d2a89e
@ -117,7 +117,7 @@ handle_cast({send_command, Ref, ReceiverPid, DeviceId, Command}, State = #state{
|
|||||||
{stop, Reason :: term(), NewState :: #state{}}).
|
{stop, Reason :: term(), NewState :: #state{}}).
|
||||||
handle_info({mqtt_message, Topic, Payload, _Qos}, State = #state{inflight = Inflight}) ->
|
handle_info({mqtt_message, Topic, Payload, _Qos}, State = #state{inflight = Inflight}) ->
|
||||||
lager:debug("[iot_mqtt_aircon_gateway] get reply of topic: ~p, payload: ~p", [Topic, Payload]),
|
lager:debug("[iot_mqtt_aircon_gateway] get reply of topic: ~p, payload: ~p", [Topic, Payload]),
|
||||||
case binary:split(Topic, <<"/">>) of
|
case binary:split(Topic, <<"/">>, [global]) of
|
||||||
[<<>>, <<"aircon">>, DeviceId, <<"command_reply">>] ->
|
[<<>>, <<"aircon">>, DeviceId, <<"command_reply">>] ->
|
||||||
Reply = catch jiffy:decode(Payload, [return_maps]),
|
Reply = catch jiffy:decode(Payload, [return_maps]),
|
||||||
case Reply of
|
case Reply of
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user