Skip to content
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

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from
Open

Runtime status #139

wants to merge 12 commits into from

Conversation

HaileyJang
Copy link
Collaborator

Oh might have some merge conflicts because of the protos submodule....

  • I am not sure if I needed anything to do with connected_to_shepherd and connected_to_dawn because the heartbeat already takes care of that

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));
Copy link
Collaborator Author

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!;
Copy link
Collaborator Author

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!;
Copy link
Collaborator Author

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.

@HaileyJang HaileyJang requested a review from ewc340 October 2, 2021 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant