Skip to content

Commit 59b2273

Browse files
committed
Merge branch 'main' into jacobhylen/P&M-launch
2 parents 321100b + fe44517 commit 59b2273

File tree

160 files changed

+3618
-808333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+3618
-808333
lines changed

.github/workflows/cloudflare.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/preview.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Preview Deployment
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, labeled]
9+
10+
concurrency:
11+
group: netlify-${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
run:
16+
if: ${{ contains(github.event.pull_request.labels.*.name, 'preview') || github.ref_name == 'main' }}
17+
runs-on: ubuntu-latest
18+
concurrency:
19+
group: netlify
20+
cancel-in-progress: false
21+
env:
22+
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
23+
APP_ENV: prod
24+
BRANCH_NAME: ${{ github.ref_name }}
25+
26+
steps:
27+
28+
- name: Find PR Preview Comment
29+
if: github.event_name == 'pull_request'
30+
uses: peter-evans/find-comment@v1
31+
id: deploy-preview-comment
32+
with:
33+
issue-number: ${{ github.event.pull_request.number }}
34+
comment-author: "github-actions[bot]"
35+
body-includes: "Preview Deployment"
36+
37+
- name: Update Comment if exists
38+
if: github.event_name == 'pull_request' && steps.deploy-preview-comment.outputs.comment-id != 0
39+
uses: peter-evans/create-or-update-comment@v1.4.5
40+
with:
41+
comment-id: ${{ steps.deploy-preview-comment.outputs.comment-id }}
42+
edit-mode: replace
43+
body: |
44+
## Preview Deployment
45+
Waiting for deployment to complete...
46+
47+
- uses: actions/checkout@v4
48+
49+
- uses: actions/setup-node@v4
50+
with:
51+
node-version: 18
52+
cache: "npm"
53+
cache-dependency-path: "**/package-lock.json"
54+
55+
- name: Render Datasheets
56+
run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh
57+
58+
- name: Copy Static Files
59+
run: |
60+
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts
61+
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
62+
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
63+
find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \;
64+
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
65+
66+
- name: Gatsby main cache
67+
uses: actions/cache@v4
68+
id: gatsby-cache-folder
69+
with:
70+
path: .cache
71+
key: ${{ runner.os }}-cache-gatsby-${{ github.sha }}
72+
restore-keys: |
73+
${{ runner.os }}-cache-gatsby-
74+
75+
- name: Gatsby Public Folder
76+
uses: actions/cache@v4
77+
id: gatsby-public-folder
78+
with:
79+
path: public/
80+
key: ${{ runner.os }}-public-gatsby-${{ github.sha }}
81+
restore-keys: |
82+
${{ runner.os }}-public-gatsby-
83+
84+
- run: npm install
85+
- run: npm run build
86+
87+
- name: Install Netlify
88+
run: npm install netlify-cli@17.23.2 -g
89+
90+
- name: Deploy to Netlify Preview
91+
if: github.event_name == 'pull_request'
92+
run: |
93+
netlify deploy \
94+
--dir public \
95+
--site ${{ secrets.NETLIFY_SITE_ID }} \
96+
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
97+
--json \
98+
> deploy_output.json
99+
100+
- name: Deploy to Netlify Prod
101+
if: github.event_name != 'pull_request'
102+
run: |
103+
netlify deploy \
104+
--prod \
105+
--dir public \
106+
--site ${{ secrets.NETLIFY_SITE_ID }} \
107+
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
108+
--json \
109+
> deploy_output.json
110+
111+
- name: Generate URL Preview
112+
if: github.event_name == 'pull_request'
113+
id: url_preview
114+
run: |
115+
NETLIFY_PREVIEW_URL=$(jq -r '.deploy_url' deploy_output.json)
116+
echo "NETLIFY_PREVIEW_URL=$NETLIFY_PREVIEW_URL" >> "$GITHUB_OUTPUT"
117+
118+
- name: Create PR Preview Comment
119+
if: github.event_name == 'pull_request' && steps.deploy-preview-comment.outputs.comment-id == 0
120+
uses: peter-evans/create-or-update-comment@v1.4.5
121+
with:
122+
issue-number: ${{ github.event.pull_request.number }}
123+
body: |
124+
## Preview Deployment
125+
🚀 Preview this PR: ${{ steps.url_preview.outputs.NETLIFY_PREVIEW_URL }}
126+
📍 Commit SHA: ${{ github.sha }}
127+
128+
- name: Update PR Preview Comment
129+
if: github.event_name == 'pull_request' && steps.deploy-preview-comment.outputs.comment-id != 0
130+
uses: peter-evans/create-or-update-comment@v1.4.5
131+
with:
132+
comment-id: ${{ steps.deploy-preview-comment.outputs.comment-id }}
133+
edit-mode: replace
134+
body: |
135+
## Preview Deployment
136+
🚀 Preview this PR: ${{ steps.url_preview.outputs.NETLIFY_PREVIEW_URL }}
137+
📍 Commit SHA: ${{ github.sha }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Broken URLs will show an error alert. URL must be in the GitHub domain and must
9494

9595
## Previewing Changes
9696

97-
Whenever you create a Pull Request (PR) GatsbyCloud will create a preview deployment in which you can see how your changes look when rendered on the website. The link to the preview will appear in the comments of the PR. This also works with Draft PRs, but not for PRs created from a fork.
97+
Whenever you create a Pull Request (PR) and the label `preview` is assigned to it, a preview is created and updated for every commit, as explained at: https://github.com/arduino/docs-content/pull/1931
9898

9999
## License
100100

content/arduino-cloud/01.guides/07.node-red/nodered-intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ You can run the simple flow shown below using Node-RED's default nodes:
100100
- drag the **"debug"** node into the workspace
101101
- connect the two nodes by dragging a wire from the message node to the debug node
102102
- click on the debug menu from the sidebar on the right
103-
- press **Depoly** from the header on the top
103+
- press **Deploy** from the header on the top
104104
- finally, press on the checkbox of the message node
105105

106106
![Creating a simple flow](assets/nodered-02.gif)
Loading
Loading
Loading
Loading
Loading
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
title: 'Google Home'
3+
description: 'Learn how to connect the Arduino Cloud with Google Home™.'
4+
tags:
5+
- Google Home
6+
author: 'Hannes Siebeneicher'
7+
featuredImage: 'cloud'
8+
---
9+
10+
## Introduction
11+
12+
This tutorial guides you on how to connect the Arduino Cloud to your Google Home™ allowing you to interact with your devices, simply through your Google Home Assistant: use voice commands, the Google Home app, or create new routines integrating Arduino solutions.
13+
14+
It requires your board to be [compatible with the Arduino Cloud](https://docs.arduino.cc/arduino-cloud/hardware/devices/).
15+
16+
## Goals
17+
18+
The goals of this tutorial are:
19+
20+
- Create a Google Home compatible variable.
21+
- Control the built-in LED with Google Home.
22+
23+
## Hardware & Software Needed
24+
25+
- [Arduino Cloud](https://cloud.arduino.cc/).
26+
- [A Cloud compatible Arduino board](https://docs.arduino.cc/arduino-cloud/hardware/devices/).
27+
- [Google Home™](https://home.google.com/welcome/).
28+
29+
To familiarize yourself with the Arduino Cloud check out our [getting started guide](https://docs.arduino.cc/arduino-cloud/guides/overview/).
30+
31+
## Cloud Setup
32+
33+
Before we start, make sure you have an Arduino Cloud compatible board.
34+
35+
Then, we need to configure a Thing in the [Arduino Cloud](https://app.arduino.cc/things) consisting of one CloudSwitch variables called `led`. Follow the instructions below to do so.
36+
37+
### Thing & Device Configuration
38+
39+
1. Create a new Thing, by clicking on the **"Create Thing"** button.
40+
2. Click on the **"Select Device"** in the **"Associated Devices"** section of your Thing.
41+
3. Click on **"Set Up New Device"**, and continue to set up your device.
42+
43+
If you need more information on how to set up your device check out our [getting started guide](https://docs.arduino.cc/arduino-cloud/guides/overview/#2-configure-a-device).
44+
45+
### Create Variables
46+
47+
The next step is to create a Cloud variable, which we will later interact with via Google Home.
48+
49+
1. While in Thing configuration, click on **"Add Variable"** which will open a new window.
50+
2. Name your variable `led`, select `Smart home`, and select it to be of a `Switch` type.
51+
52+
![Create Variable](./assets/thingConfig.png)
53+
54+
3. Click on **"Add Variable"** at the bottom of the window.
55+
4. Make sure the **Smart Home Integration** is set to Google Home.
56+
57+
![Smart Home Integration](./assets/smartHomeIntegration.png)
58+
59+
***Most Cloud variables are compatible with both Alexa and Google Home but there is an icon on the right side of the type that indicates the compatibility***
60+
61+
Your Thing should look something like this when you are finished:
62+
63+
![Finished Thing interface.](./assets/thing.png)
64+
65+
***Learn more about how variables work in the [Variables documentation](/arduino-cloud/cloud-interface/variables)***
66+
67+
### Upload Sketch
68+
69+
Navigate to the Sketch tab and upload the following sketch to your Arduino board.
70+
71+
```arduino
72+
73+
74+
#include "thingProperties.h"
75+
76+
void setup() {
77+
// Initialize serial and wait for port to open:
78+
Serial.begin(9600);
79+
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
80+
delay(1500);
81+
82+
// Defined in thingProperties.h
83+
initProperties();
84+
85+
// Connect to Arduino IoT Cloud
86+
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
87+
88+
/*
89+
The following function allows you to obtain more information
90+
related to the state of network and IoT Cloud connection and errors
91+
the higher number the more granular information you’ll get.
92+
The default is 0 (only errors).
93+
Maximum is 4
94+
*/
95+
setDebugMessageLevel(2);
96+
ArduinoCloud.printDebugInfo();
97+
}
98+
99+
void loop() {
100+
ArduinoCloud.update();
101+
digitalWrite(LED_BUILTIN, led);
102+
103+
}
104+
105+
106+
/*
107+
Since Led is READ_WRITE variable, onLedChange() is
108+
executed every time a new value is received from IoT Cloud.
109+
*/
110+
void onLedChange() {
111+
// Add your code here to act upon Led change
112+
}
113+
114+
```
115+
116+
Your board setup is now complete and you can continue to the Google Home app.
117+
118+
### Detect Your Device with Google Home
119+
120+
- **Network Connection:** Ensure the board is connected to the network.
121+
122+
- **Google Home App:** Open the app, navigate to Devices, and click "Add Device."
123+
124+
- **Integration Method:** Select "Works with Google Home" and then choose the "Arduino" action.
125+
126+
![Setup Device](./assets/googleHome_1.png)
127+
128+
- **Device Pairing:** Link your Arduino account if requested and proceed to add your devices (one for each variable) by associating them with a room.
129+
130+
![Link Accounts](./assets/googleHome_2.png)
131+
132+
**Congratulations!** Your device is now successfully configured to work with Google Home.
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)