fix device status
This commit is contained in:
parent
6bd2528ad5
commit
0e23d87c88
@ -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;
|
||||||
|
|
||||||
%% 处理授权
|
%% 处理授权
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user