Skip to content

Commit 29db546

Browse files
committed
Eliminate trailing whitespace
1 parent 5802cf1 commit 29db546

25 files changed

+148
-117
lines changed

.github/workflows/check.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
on: [push, pull_request]
22
jobs:
3+
trailing-whitespace:
4+
runs-on: ubuntu-24.04
5+
steps:
6+
- uses: actions/checkout@v4.2.2
7+
with:
8+
fetch-depth: 0
9+
- name: Check for trailing whitespace
10+
run: |
11+
set -u
12+
13+
# Don't enforce checks on vendored libraries.
14+
readonly EXCLUDED_DIR='src/Libraries'
15+
16+
has_trailing_whitespace=false
17+
18+
while read -r line; do
19+
if grep \
20+
"\s$" \
21+
--line-number \
22+
--with-filename \
23+
--binary-files=without-match \
24+
"${line}"; then
25+
has_trailing_whitespace=true
26+
fi
27+
done < <(git ls-files | grep --invert-match "^${EXCLUDED_DIR}/")
28+
29+
if [ "$has_trailing_whitespace" = true ]; then
30+
echo "ERROR: Found trailing whitespace"
31+
exit 1
32+
fi
33+
334
compile:
435
strategy:
536
fail-fast: false

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Each GitHub release note will also include the planned rollout date for wider av
3232

3333
## Help & Support
3434

35-
If you have any questions or problems, check out [our forum](https://forum.airgradient.com/).
35+
If you have any questions or problems, check out [our forum](https://forum.airgradient.com/).
3636

3737
## Development
3838

docs/howto-compile.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ Arduino IDE version 2.x ([download](https://www.arduino.cc/en/software))
1616

1717
#### Version < 3.2.0
1818

19-
Using library manager install the latest version (Tools ➝ Manage Libraries... ➝ search for `"airgradient"`)
19+
Using library manager install the latest version (Tools ➝ Manage Libraries... ➝ search for `"airgradient"`)
2020

2121
![Aigradient Library](images/ag-lib.png)
2222

2323
#### Version >= 3.3.0
2424

2525
- From your terminal, go to Arduino libraries folder (windows and mac: `Documents/Arduino/libraries` or linux: `~/Arduino/Libraries`).
26-
- With **git** cli, execute this command `git clone --recursive https://github.com/airgradienthq/arduino.git AirGradient_Air_Quality_Sensor`
27-
- Restart Arduino IDE
26+
- With **git** cli, execute this command `git clone --recursive https://github.com/airgradienthq/arduino.git AirGradient_Air_Quality_Sensor`
27+
- Restart Arduino IDE
2828

2929
3. On tools tab, follow settings below
3030

@@ -57,15 +57,15 @@ Upload Speed ➝ 921600
5757

5858
![board manager](images/esp8266-board.png)
5959

60-
3. Install AirGradient library on library manager using the latest version (Tools ➝ Manage Libraries... ➝ search for `"airgradient"`)
60+
3. Install AirGradient library on library manager using the latest version (Tools ➝ Manage Libraries... ➝ search for `"airgradient"`)
6161

6262
![Aigradient Library](images/ag-lib.png)
6363

6464
4. On tools tab, set board to `LOLIN(WEMOS) D1 R2 & mini`, and let other settings to default
6565

6666
![settings esp8266](images/settings-esp8266.png)
6767

68-
5. Open sketch to compile (File ➝ Examples ➝ AirGradient Air Quality Sensor ➝ `<Model Option>`). Depends on the DIY model, either `BASIC`, `DiyProIndoorV3_3` and `DiyProIndoorV4_2`
68+
5. Open sketch to compile (File ➝ Examples ➝ AirGradient Air Quality Sensor ➝ `<Model Option>`). Depends on the DIY model, either `BASIC`, `DiyProIndoorV3_3` and `DiyProIndoorV4_2`
6969
6. Compile
7070

7171
![compiled esp8266](images/compiled-esp8266.png)
@@ -78,13 +78,13 @@ ModuleNotFoundError: No module named ‘serial’
7878

7979
![Linux Failed](images/linux-failed.png)
8080

81-
Make sure python pyserial module installed globally in the environment by executing:
81+
Make sure python pyserial module installed globally in the environment by executing:
8282

8383
`$ sudo apt install -y python3-pyserial`
8484

85-
or
85+
or
8686

87-
`$ pip install pyserial`
87+
`$ pip install pyserial`
8888

8989
Choose based on how python installed on your machine. But most user, using `apt` is better.
9090

docs/local-server.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Local Server API
22

3-
From [firmware version 3.0.10](firmwares) onwards, the AirGradient ONE and Open Air monitors have below API available.
3+
From [firmware version 3.0.10](firmwares) onwards, the AirGradient ONE and Open Air monitors have below API available.
44

55
### Discovery
66

@@ -20,7 +20,7 @@ http://airgradient_ecda3b1eaaaf.local/measures/current
2020
“ecda3b1eaaaf” being the serial number of your monitor.
2121

2222
You get the following response:
23-
```json
23+
```json
2424
{
2525
"wifi": -46,
2626
"serialno": "ecda3b1eaaaf",
@@ -84,7 +84,7 @@ Compensated values apply correction algorithms to make the sensor values more ac
8484

8585
"/config" path returns the current configuration of the monitor.
8686

87-
```json
87+
```json
8888
{
8989
"country": "TH",
9090
"pmStandard": "ugm3",
@@ -118,22 +118,22 @@ Configuration parameters can be changed with a PUT request to the monitor, e.g.
118118
Example to force CO2 calibration
119119

120120
```bash
121-
curl -X PUT -H "Content-Type: application/json" -d '{"co2CalibrationRequested":true}' http://airgradient_84fce612eff4.local/config
121+
curl -X PUT -H "Content-Type: application/json" -d '{"co2CalibrationRequested":true}' http://airgradient_84fce612eff4.local/config
122122
```
123123

124124
Example to set monitor to Celsius
125125

126126
```bash
127-
curl -X PUT -H "Content-Type: application/json" -d '{"temperatureUnit":"c"}' http://airgradient_84fce612eff4.local/config
127+
curl -X PUT -H "Content-Type: application/json" -d '{"temperatureUnit":"c"}' http://airgradient_84fce612eff4.local/config
128128
```
129129

130130
If you use command prompt on Windows, you need to escape the quotes:
131-
131+
132132
``` -d "{\"param\":\"value\"}" ```
133133

134134
### Avoiding Conflicts with Configuration on AirGradient Server
135135

136-
If the monitor is set up on the AirGradient dashboard, it will also receive the configuration parameters from there. In case you do not want this, please set `configurationControl` to `local`. In case you set it to `cloud` and want to change it to `local`, you need to make a factory reset.
136+
If the monitor is set up on the AirGradient dashboard, it will also receive the configuration parameters from there. In case you do not want this, please set `configurationControl` to `local`. In case you set it to `cloud` and want to change it to `local`, you need to make a factory reset.
137137

138138
### Configuration Parameters (GET/PUT)
139139

@@ -204,34 +204,34 @@ Example correction configuration:
204204
Field Name: `pm02`
205205

206206
| Algorithm | Value | Description | SLR required |
207-
|------------|-------------|------|---------|
207+
|------------|-------------|------|---------|
208208
| Raw | `"none"` | No correction (default) | No |
209209
| EPA 2021 | `"epa_2021"` | Use EPA 2021 correction factors on top of raw value | No |
210-
| PMS5003_20240104 | `"slr_PMS5003_20240104"` | Correction for PMS5003 sensor batch 20240104| Yes |
210+
| PMS5003_20240104 | `"slr_PMS5003_20240104"` | Correction for PMS5003 sensor batch 20240104| Yes |
211211
| PMS5003_20231218 | `"slr_PMS5003_20231218"` | Correction for PMS5003 sensor batch 20231218| Yes |
212212
| PMS5003_20231030 | `"slr_PMS5003_20231030"` | Correction for PMS5003 sensor batch 20231030| Yes |
213213

214-
**NOTES**:
214+
**NOTES**:
215215

216216
- Set `useEpa2021` to `true` if want to apply EPA 2021 correction factors on top of SLR correction value, otherwise `false`
217217
- `intercept` and `scalingFactor` values can be obtained from [this article](https://www.airgradient.com/blog/low-readings-from-pms5003/)
218-
- If `configurationControl` is set to `local` (eg. when using Home Assistant), correction need to be set manually, see examples below
218+
- If `configurationControl` is set to `local` (eg. when using Home Assistant), correction need to be set manually, see examples below
219219

220220
**Examples**:
221221

222-
- PMS5003_20231030
222+
- PMS5003_20231030
223223

224224
```bash
225225
curl --location -X PUT 'http://airgradient_84fce612eff4.local/config' --header 'Content-Type: application/json' --data '{"corrections":{"pm02":{"correctionAlgorithm":"slr_PMS5003_20231030","slr":{"intercept":0,"scalingFactor":0.02838,"useEpa2021":true}}}}'
226226
```
227227

228-
- PMS5003_20231218
228+
- PMS5003_20231218
229229

230230
```bash
231231
curl --location -X PUT 'http://airgradient_84fce612eff4.local/config' --header 'Content-Type: application/json' --data '{"corrections":{"pm02":{"correctionAlgorithm":"slr_PMS5003_20231218","slr":{"intercept":0,"scalingFactor":0.03525,"useEpa2021":true}}}}'
232232
```
233233

234-
- PMS5003_20240104
234+
- PMS5003_20240104
235235

236236
```bash
237237
curl --location -X PUT 'http://airgradient_84fce612eff4.local/config' --header 'Content-Type: application/json' --data '{"corrections":{"pm02":{"correctionAlgorithm":"slr_PMS5003_20240104","slr":{"intercept":0,"scalingFactor":0.02896,"useEpa2021":true}}}}'
@@ -244,10 +244,10 @@ Field Name:
244244
- Humidity: `rhum`
245245

246246
| Algorithm | Value | Description | SLR required |
247-
|------------|-------------|------|---------|
247+
|------------|-------------|------|---------|
248248
| Raw | `"none"` | No correction (default) | No |
249249
| AirGradient Standard Correction | `"ag_pms5003t_2024"` | Using standard airgradient correction (for outdoor monitor)| No |
250-
| Custom | `"custom"` | custom corrections constant, set `intercept` and `scalingFactor` manually | Yes |
250+
| Custom | `"custom"` | custom corrections constant, set `intercept` and `scalingFactor` manually | Yes |
251251

252252
*Table above apply for both Temperature and Humidity*
253253

docs/ota-updates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## OTA Updates
22

3-
From [firmware version 3.1.1](https://github.com/airgradienthq/arduino/tree/3.1.1) onwards, the AirGradient ONE and Open Air monitors support over the air (OTA) updates.
3+
From [firmware version 3.1.1](https://github.com/airgradienthq/arduino/tree/3.1.1) onwards, the AirGradient ONE and Open Air monitors support over the air (OTA) updates.
44

55
#### Mechanism
66

@@ -10,7 +10,7 @@ The device attempts to update to the latest version on startup and in regular in
1010

1111
http://hw.airgradient.com/sensors/{deviceId}/generic/os/firmware.bin?current_firmware={GIT_VERSION}
1212

13-
If does pass the version it is currently running on along to the server through URL parameter 'current_firmware'.
13+
If does pass the version it is currently running on along to the server through URL parameter 'current_firmware'.
1414
This allows the server to identify if the device is already running on the latest version or should update.
1515

1616
The following scenarios are possible

examples/DiyProIndoorV4_2/DiyProIndoorV4_2.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ void loop() {
249249
configUpdateHandle();
250250

251251
localServer._handle();
252-
252+
253253
if (configuration.hasSensorSGP) {
254254
ag.sgp41.handle();
255255
}

0 commit comments

Comments
 (0)