Skip to content

Conversation

@hbradio
Copy link
Contributor

@hbradio hbradio commented Jun 7, 2020

This PR

  • wires up the light sensors and the battery voltage
    • stores the readings in Redux
    • displays the readings in the "Sensors" section of the right-hand panel
    • stops logging these readings to the debug console
    • makes the "left/right light sensor value" block actually get the real values
    • (there is got "battery voltage value" block yet, so nothing to do there)

I mostly wanted to get the light sensors wired up, but I went ahead and also did the battery voltage as an example of how to use the NumericalSensorReadout component in a different way.

sensors

@hbradio hbradio requested a review from cabarnes June 7, 2020 13:44
@hbradio hbradio self-assigned this Jun 7, 2020
"build": "webpack --config webpack.production.js",
"i18n:manage": "node src/translations/runner.js",
"test": "jest --coverage --color",
"test:interactive": "jest --watch --coverage --color",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tool is ... interesting. I'm not sure if it made things faster for me or not, but it's worth trying out!

classes,
}) => (
<>
<ExpansionPanelDetails>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love that we assume that this component is used inside an ExpansionPanel. However, if you don't put things inside their own ExpansionPanelDetails, it tries to smash them together side-by-side for some reason. I thought this solution would work ok for now.

<FormattedMessage
id="app.mission_control.buttons"
description="Describes the buttons sensor section"
defaultMessage="Buttons"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I added this label here to show what it will look like, but I did not yet change the functionality of these indicators. They are still hooked up to change with the light sensor values. We'll need to change them to show "button has been pressed" in the next PR.

@@ -0,0 +1,47 @@
import React from 'react';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of this file is inconsistent with the module it is testing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

import NumericSensorReadout from '../NumericSensorReadout';

describe('The NumericSensorReadout component', () => {
test('renders values on the page with no erros when values present', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errors

Copy link
Member

@cabarnes cabarnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@hbradio hbradio merged commit 1f299a7 into alpha Jun 8, 2020
@cabarnes cabarnes deleted the connect-light-sensors branch June 8, 2020 14:42
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.

3 participants