WIP More Wifi setup
This commit is contained in:
@@ -87,6 +87,7 @@ export class DeviceReduxCoupling {
|
||||
this._onNewData,
|
||||
(sessionId) => this.reduxStore.dispatch(reportSessionStarted(sessionId)),
|
||||
() => this.reduxStore.dispatch(reportSessionStopped()),
|
||||
(response) => this.reduxStore.dispatch(reportNewWifiState(response["state"])),
|
||||
() => this.reduxStore.dispatch(reportDeviceConnect()),
|
||||
() => this.reduxStore.dispatch(reportDeviceDisconnect())
|
||||
);
|
||||
@@ -152,15 +153,14 @@ export const deviceStateReducer = (state = INITIAL_DEVICE_STATE, action) => {
|
||||
return state;
|
||||
return { ...INITIAL_DEVICE_STATE, connState: ConnState.CONNECTED_STOPPING };
|
||||
case WIFI_SET_STATE:
|
||||
console.log("here");
|
||||
let wifState = WifiState.UNKNOWN;
|
||||
if (action.data === "STATION_MODE") { wifState = WifiState.STA; }
|
||||
else if (action.data === "AP_PROVISIONING") { wifState = WifiState.AP_PROVISIONING; }
|
||||
else if (action.data === "AP_SECURE") { wifState = WifiState.AP_SECURE; }
|
||||
if (action.newStateStr === "STATION_MODE") { wifState = WifiState.STA; }
|
||||
else if (action.newStateStr === "AP_PROVISIONING") { wifState = WifiState.AP_PROVISIONING; }
|
||||
else if (action.newStateStr === "AP_SECURE") { wifState = WifiState.AP_SECURE; }
|
||||
return { ...state, wifiState: wifState };
|
||||
default:
|
||||
console.log("Unhandled state in deviceStateReducer", action, action.type);
|
||||
return state
|
||||
//console.log("Unhandled state in deviceStateReducer", action, action.type, "state", state);
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user