-
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
Added Anemometer functionality to be displayed on the dashboard #169
base: master
Are you sure you want to change the base?
Conversation
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.
This is looking great so far! I haven't run the code yet, just did a code review, but it seems to go well with how the code in this repository is structured.
One major task we still need to integrate is to actually listen to the wind speed and direction data from MQTT in the backend (/server/js/socket.js
). How the data gets read from MQTT and relayed to the front-end can be a bit hard to understand, I would suggest picking another WM and tracking how it gets its data. A good place to start would be subscribing to the topic that sends the anemometer data.
client/src/types/data.ts
Outdated
@@ -117,6 +126,9 @@ export type CO2T = Static<typeof CO2RT>; | |||
/** Value type of accelerometer sensor data */ | |||
export type AccelerometerT = Static<typeof AccelerometerRT>; | |||
|
|||
/** Value type of aneomometer sensor data */ | |||
export type AnemometerRT = Static<typeof AnemometerRT>; |
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.
export type AnemometerRT = Static<typeof AnemometerRT>; | |
export type AnemometerT = Static<typeof AnemometerRT>; |
we already define a variable called AnemometerRT
above, here we define a type and although we could still use the same name, it won't make sense since it's not AnemometerRT. The 'RT' stands for RunType and is not strictly a type
in TypeScript. Some background reading if you're interested to know what RunType is and why we use it.
In short, some places in our code accept a variable that represents our data, so we use AnemometerRT
, but in other places we need to use a type so we define a type called AnemometerT
.
import { useModuleStatus } from 'api/common/data'; | ||
|
||
/** | ||
* Container for Wireless Module Statuses |
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.
Need to update the function documentation
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.
Do we need this file? We could use WMStatus.tsx to achieve the same objective...
Description
Added new files for display on the anemometer
Screenshots
Steps to Test