-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime status #139
base: dev
Are you sure you want to change the base?
Runtime status #139
Conversation
case MsgType.RUNTIME_STATUS: | ||
decoded = protos.RuntimeStatus.decode(packet.payload); | ||
//Not sure if we need to update runtimeStatus state bcs heartbeat keeps track of that already | ||
RendererBridge.reduxDispatch(updateCodeStatus(decoded.mode)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runtime Status sends us the current run mode it is in. Calls the updateCodeStatus action to change the mode
if (batteryParams[IS_UNSAFE] && batteryParams[IS_UNSAFE].bval) { | ||
nextState.batterySafety = batteryParams[IS_UNSAFE].bval!; | ||
} | ||
if (batteryParams[V_BATT] && batteryParams[V_BATT].fval) { | ||
nextState.batteryLevel = batteryParams[V_BATT].fval!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got removed because the batteryLevel is already changed from calling changeBatteryLevel in runtime.ts
@@ -32,12 +30,10 @@ export const peripherals = (state: PeripheralState = initialPeripheralState, act | |||
(action.peripherals ?? []).forEach((peripheral: Peripheral) => { | |||
if (peripheral.name === consts.PeripheralTypes.BatteryBuzzer) { | |||
const batteryParams = peripheral.params; | |||
//since batterysafety is not included in runtimestatus, have to extract the value from params | |||
if (batteryParams[IS_UNSAFE] && batteryParams[IS_UNSAFE].bval) { | |||
nextState.batterySafety = batteryParams[IS_UNSAFE].bval!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However batterysafety is not included in the runtime status thus extracted manually.
Oh might have some merge conflicts because of the protos submodule....