fix device status

This commit is contained in:
anlicheng 2023-09-04 14:05:26 +08:00
parent 6bd2528ad5
commit 0e23d87c88

View File

@ -120,7 +120,7 @@ handle_event(cast, {change_status, ?DEVICE_ONLINE}, ?STATE_ACTIVATED, State = #s
%% , %% ,
handle_event(cast, {change_status, NewStatus}, _, State = #state{device_uuid = DeviceUUID}) -> handle_event(cast, {change_status, NewStatus}, _, State = #state{device_uuid = DeviceUUID}) ->
{ok, _} = device_bo:change_status(DeviceUUID, NewStatus), {ok, _} = device_bo:change_status(DeviceUUID, NewStatus),
{keep_state, State}; {keep_state, State#state{status = NewStatus}};
%% %%
handle_event(cast, reload, _, State = #state{device_uuid = DeviceUUID}) -> handle_event(cast, reload, _, State = #state{device_uuid = DeviceUUID}) ->
@ -136,7 +136,7 @@ handle_event(cast, reload, _, State = #state{device_uuid = DeviceUUID}) ->
end; end;
undefined -> undefined ->
lager:warning("[iot_device] device uuid: ~p, loaded from mysql failed", [DeviceUUID]), lager:warning("[iot_device] device uuid: ~p, loaded from mysql failed", [DeviceUUID]),
{keep_state, State} {stop, normal, State}
end; end;
%% %%