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

Magic Config updates #127

Merged
merged 65 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
974fc35
fix image regexes
lorennorman Oct 17, 2023
fd75b76
Merge branch 'main' into json-repo-updates
lorennorman Nov 7, 2023
d801998
make a magic config for funhouse
lorennorman Nov 7, 2023
8cd6881
add funhouse buttons
lorennorman Nov 7, 2023
2225f79
allow magic.json file
lorennorman Nov 8, 2023
9ae63d2
new schema, new validation task
lorennorman Nov 8, 2023
5a91d00
fix invalid json, add is* (servo/uart/ds18x20)
lorennorman Nov 8, 2023
6f7c780
rename action
lorennorman Nov 8, 2023
cd0f09f
allow "selected" prop
lorennorman Nov 8, 2023
7292d25
allow the magic_schema.json file
lorennorman Nov 8, 2023
115042b
try oneOf
lorennorman Nov 8, 2023
0d2fb88
try it on just a pin component
lorennorman Nov 8, 2023
e8098c3
oneOf wip
lorennorman Nov 8, 2023
2a8ab0f
again
lorennorman Nov 8, 2023
bcce9e2
try with "required"
lorennorman Nov 8, 2023
77c5a8a
try again
lorennorman Nov 8, 2023
d4040c2
add "required" to each oneOf
lorennorman Nov 8, 2023
aa1f766
juggle additionalProperties
lorennorman Nov 8, 2023
ff2bfe7
test if required is working
lorennorman Nov 8, 2023
42e7182
test outer properties
lorennorman Nov 8, 2023
eceb198
try again
lorennorman Nov 8, 2023
0f15654
try without oneOf for a sec
lorennorman Nov 8, 2023
0723269
put required into oneof
lorennorman Nov 8, 2023
b2c2118
move pin fields into oneOf
lorennorman Nov 8, 2023
d9ee333
wip
lorennorman Nov 8, 2023
a45a229
wip
lorennorman Nov 8, 2023
edecd24
add i2c back
lorennorman Nov 8, 2023
d2f99c4
faster actions, period and pull for pins
lorennorman Nov 8, 2023
dd5060f
test breakage
lorennorman Nov 8, 2023
f7fc652
names in oneOf, types out
lorennorman Nov 8, 2023
514e017
pixels and pwms
lorennorman Nov 8, 2023
bc76b8f
oops
lorennorman Nov 8, 2023
6d5593a
rest of the types roughed in
lorennorman Nov 8, 2023
163cfb5
check all props, forgot neopixels do pinName
lorennorman Nov 10, 2023
2c9e99a
snake_case -> camelCase
lorennorman Nov 10, 2023
5745d81
one more camel
lorennorman Nov 10, 2023
91b4766
fresh export
lorennorman Nov 10, 2023
db69149
use `productURL` to match components json
lorennorman Nov 13, 2023
9df852a
Fix note/labels. Add D0 boot buttons + S3TFT conf
tyeth Nov 13, 2023
9350e03
oops, lets try to use real integers
lorennorman Nov 14, 2023
df4e5ef
Merge branch 'json-repo-updates' into all-magic-configs
lorennorman Nov 14, 2023
e4ecdce
get rid of leaky strings
lorennorman Nov 14, 2023
471a3c1
Merge branch 'json-repo-updates' into all-magic-configs
lorennorman Nov 14, 2023
42e2844
Update feather esp32 s2/s3 tfts
tyeth Nov 15, 2023
7c00a70
add pull down to funhouse button!
lorennorman Nov 15, 2023
3b529cc
More boards
tyeth Nov 16, 2023
51804f0
Remove speaker from magic config for pyportal
tyeth Nov 16, 2023
71291f8
Remove magic conf in image folder
tyeth Nov 16, 2023
7c16569
magtag
tyeth Nov 17, 2023
c77ba21
add m4-wifi
tyeth Nov 17, 2023
5530bc9
Correct Neopixel count to 1
tyeth Nov 17, 2023
2acd713
Fix funhouse light sensor A3 conflict with D3
tyeth Nov 21, 2023
d9aa052
remove non-existent button from esp8266
tyeth Nov 21, 2023
9fe5cab
Enable both LEDs by default on Feather ESP8266
tyeth Nov 21, 2023
cd984fa
Removed selected: true as not allowed/necessary
tyeth Nov 21, 2023
9aa04c2
Correct Address of funhouse DPS310 + Light sensor
tyeth Nov 21, 2023
82e7024
Update default polling period from 900 to 30
tyeth Nov 22, 2023
8472bf2
Fix MagTag + Use AnalogPin instead of Potentiometer
tyeth Nov 27, 2023
8a32100
Correct VBat ADC Pin names / displaynames
tyeth Nov 27, 2023
73d8da5
re-enable all CI checks
lorennorman Nov 28, 2023
d035a50
Last Analog pins still D-named
tyeth Nov 28, 2023
51bc029
Merge branch 'all-magic-configs' of https://github.com/adafruit/Wippe…
tyeth Nov 28, 2023
0d8ab93
Analog must be A prefixed - magtag
tyeth Nov 28, 2023
82d4c43
Merge pull request #130 from adafruit/all-magic-configs
lorennorman Nov 29, 2023
26136ef
allow staff to touch README
lorennorman Nov 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 14 additions & 7 deletions .github/workflows/validate.yml
Expand Up @@ -4,18 +4,24 @@ on: [pull_request]

jobs:
validate-definition-files:
name: Validate Definition Files
name: Validate JSON Schemas
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

# Schema Docs: https://ajv.js.org/json-schema.html#json-data-type
- name: Validate Board JSON
uses: lorennorman/validate-json-action@master
with:
# Schema Docs: https://ajv.js.org/json-schema.html#json-data-type
schema: /boards/schema.json
jsons: boards/*/definition.json

- name: Validate Magic JSON
uses: lorennorman/validate-json-action@master
with:
schema: /boards/magic_schema.json
jsons: boards/*/magic.json

check-user-permissions:
name: Check Write Permission
runs-on: ubuntu-latest
Expand All @@ -29,6 +35,7 @@ jobs:
route: GET /repos/${{ github.repository }}/collaborators/${{ github.actor }}/permission
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- id: set-permission
if: fromJson(steps.fetch-permissions.outputs.data).permission == 'admin' || fromJson(steps.fetch-permissions.outputs.data).permission == 'write'
run: echo "has-permission=true" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -65,10 +72,10 @@ jobs:
# TODO: break these regexes up into modular chunks that check specific things for readability and composability

# external contributors can modify some files
EXTERNAL_REGEX="^boards\/.*\/(definition\.json|((image|images\/(boot-(drive|loader)|drag-drop|reset|usb))\.(png|jpe?g|gif|svg)))$"
EXTERNAL_REGEX="^boards\/.*\/(definition\.json|magic\.json|((image|images\/(boot-(drive|loader)|drag-drop|reset|usb))\.(png|jpe?g|gif|svg)))$"

# folks with write access to the repo (Adafruit team) can change more sensitive files
INTERNAL_REGEX="^(\.github\/.*|boards\/(schema.json|.*\/(definition\.json|((image|images\/(boot-(drive|loader)|drag-drop|reset|usb))\.(png|jpe?g|gif|svg)))))$"
INTERNAL_REGEX="^(README.md|\.github\/.*|boards\/(schema.json|magic_schema.json|.*\/(definition\.json|magic\.json|((image|images\/(boot-(drive|loader)|drag-drop|reset|usb))\.(png|jpe?g|gif|svg)))))$"

# apply the appropriate regex based on permissions of the user
if [[ $CAN_WRITE_TO_REPO ]]; then
Expand Down Expand Up @@ -104,7 +111,7 @@ jobs:
EXIT_VALUE=0

for FILE in $FILES; do
if ! [[ $FILE =~ "\.(svg|jpe?g|png)$" ]]; then
if ! [[ $FILE =~ \.(svg|jpe?g|png)$ ]]; then
continue # non-image file
fi

Expand Down Expand Up @@ -164,7 +171,7 @@ jobs:
MAX_HEIGHT=2000

for FILE in $FILES; do
if ! [[ $FILE =~ "\.(svg|jpe?g|png)$" ]]; then
if ! [[ $FILE =~ \.(svg|jpe?g|png)$ ]]; then
continue # non-image file
fi

Expand Down Expand Up @@ -223,7 +230,7 @@ jobs:
MAX_ANIGIF_FILESIZE=$((1000*1024)) # 1MB

for FILE in $FILES; do
if ! [[ $FILE =~ "\.(svg|jpe?g|png)$" ]]; then
if ! [[ $FILE =~ \.(svg|jpe?g|png)$ ]]; then
continue # non-image file
fi

Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -22,7 +22,7 @@ Information related to the hardware including the hardware's name, description a
| mcuRefVoltage | Yes | Float | Microcontroller's maximum voltage reference, in Volts. |
| displayName | Yes | String | Adafruit IO Device name |
| description | No | String | Device description |
| productPageURL | Yes | String | Link to board's homepage. |
| productURL | Yes | String | Link to board's homepage. |
| documentationURL | Yes | String | Link to board's documentation. |


Expand Down Expand Up @@ -79,4 +79,4 @@ The following HDM snippet defines an I2C interface on port 0 with a `SDA` GPIO p
Example hardware descriptions can be found in the `boards/` directory.

# Limitations
* The Adafruit IO WipperSnapper Firmware currently supports the following microcontrollers with a WiFi network interface: ESP8266, ESP32, ESP32-S2, ESP32-S3, SAMD51, SAMD21.
* The Adafruit IO WipperSnapper Firmware currently supports the following microcontrollers with a WiFi network interface: ESP8266, ESP32, ESP32-S2, ESP32-S3, SAMD51, SAMD21.
6 changes: 3 additions & 3 deletions boards/feather-esp32-v2/definition.json
Expand Up @@ -4,7 +4,7 @@
"mcuRefVoltage": 3.3,
"displayName":"Adafruit Feather ESP32 V2",
"vendor":"Adafruit",
"productPageURL":"https://www.adafruit.com/product/5400",
"productURL":"https://www.adafruit.com/product/5400",
"documentationURL":"https://learn.adafruit.com/adafruit-esp32-feather-v2",
"installMethod":"web",
"esptool": {
Expand Down Expand Up @@ -197,8 +197,8 @@
"hasServo":true
},
{
"name":"A13",
"displayName":"A13 (VBat Monitor)",
"name":"A35",
"displayName":"VBat Monitor",
"dataType":"int16"
}
],
Expand Down
51 changes: 51 additions & 0 deletions boards/feather-esp32-v2/magic.json
@@ -0,0 +1,51 @@
{
"exportVersion": "1.0.0",
"exportedBy": "Adafruit",
"exportedAt": "2023-11-13T19:41:29.465Z",
"exportedFromDevice": {
"board": "feather-esp32-v2",
"firmwareVersion": "1.0.0-beta.73"
},
"components": [
{
"name": "Button (D0/Boot)",
"pinName": "D38",
"type": "push_button",
"mode": "DIGITAL",
"direction": "INPUT",
"period": 0,
"isPin": true,
"pull": "UP"
},
{
"name": "Dimmable LED",
"type": "dimmable_led",
"pwmSetting": "fixedFrequency",
"frequency": 5000,
"resolution": 12,
"pinName": "D13",
"isPWM": true,
"selected": false
},
{
"name": "NeoPixel",
"pixelNumber": 1,
"pixelsOrder": "GRB",
"pixelBrightness": 255,
"pinName": "D0",
"type": "neopixel",
"pixelsType": "NEOPIXEL",
"isPixel": true
},
{
"name": "Battery ADC",
"pinName": "A35",
"type": "analog_pin",
"mode": "ANALOG",
"direction": "INPUT",
"analogReadMode": "PIN_VOLTAGE",
"period": 30,
"isPin": true
}
]
}
4 changes: 2 additions & 2 deletions boards/feather-esp32/definition.json
Expand Up @@ -4,7 +4,7 @@
"mcuRefVoltage": 3.3,
"displayName":"Adafruit Feather HUZZAH ESP32",
"vendor":"Adafruit",
"productPageURL":"https://www.adafruit.com/product/3405",
"productURL":"https://www.adafruit.com/product/3405",
"documentationURL":"https://learn.adafruit.com/adafruit-huzzah32-esp32-feather",
"installMethod":"web",
"esptool": {
Expand Down Expand Up @@ -209,7 +209,7 @@
},
{
"name":"A35",
"displayName":"VBAT",
"displayName":"A13 (VBAT)",
"dataType":"int16"
}
],
Expand Down
31 changes: 31 additions & 0 deletions boards/feather-esp32/magic.json
@@ -0,0 +1,31 @@
{
"exportVersion": "1.0.0",
"exportedBy": "Adafruit",
"exportedAt": "2023-11-13T19:41:29.465Z",
"exportedFromDevice": {
"board": "feather-esp32",
"firmwareVersion": "1.0.0-beta.73"
},
"components": [
{
"name": "Dimmable LED",
"type": "dimmable_led",
"pwmSetting": "fixedFrequency",
"frequency": 5000,
"resolution": 12,
"pinName": "D13",
"isPWM": true,
"selected": false
},
{
"name": "Battery ADC",
"pinName": "A35",
"type": "analog_pin",
"mode": "ANALOG",
"direction": "INPUT",
"analogReadMode": "PIN_VOLTAGE",
"period": 30,
"isPin": true
}
]
}
7 changes: 4 additions & 3 deletions boards/feather-esp32s2-reverse-tft/definition.json
Expand Up @@ -4,15 +4,16 @@
"mcuRefVoltage":2.6,
"displayName":"ESP32-S2 Reverse TFT Feather",
"vendor":"Adafruit",
"productPageURL":"https://www.adafruit.com/product/5345",
"productURL":"https://www.adafruit.com/product/5345",
"documentationURL":"https://learn.adafruit.com/esp32-s2-reverse-tft-feather",
"installMethod":"uf2",
"components":{
"digitalPins":[
{
"name":"D0",
"displayName":"D0 Push Button",
"dataType":"bool"
"displayName":"D0 (Boot Push Button)",
"dataType":"bool",
"direction":"INPUT"
},
{
"name":"D1",
Expand Down
93 changes: 93 additions & 0 deletions boards/feather-esp32s2-reverse-tft/magic.json
@@ -0,0 +1,93 @@
{
"exportVersion": "1.0.0",
"exportedBy": "Adafruit",
"exportedAt": "2023-11-15T19:21:27.557Z",
"exportedFromDevice": {
"board": "feather-esp32s2-reverse-tft",
"firmwareVersion": "1.0.0-beta.73"
},
"components": [
{
"name": "Button D0",
"pinName": "D0",
"type": "push_button",
"mode": "DIGITAL",
"direction": "INPUT",
"period": 0,
"pull": "UP",
"isPin": true
},
{
"name": "Button D1",
"pinName": "D1",
"type": "push_button",
"mode": "DIGITAL",
"direction": "INPUT",
"period": 0,
"pull": "DOWN",
"isPin": true
},
{
"name": "Button D2",
"pinName": "D2",
"type": "push_button",
"mode": "DIGITAL",
"direction": "INPUT",
"period": 0,
"pull": "DOWN",
"isPin": true
},
{
"name": "Dimmable LED",
"type": "dimmable_led",
"pwmSetting": "fixedFrequency",
"frequency": 5000,
"resolution": 12,
"pinName": "D13",
"isPWM": true,
"selected": false
},
{
"name": "NeoPixel",
"pixelNumber": 1,
"pixelsOrder": "GRB",
"pixelBrightness": 255,
"pinName": "D33",
"type": "neopixel",
"pixelsType": "NEOPIXEL",
"isPixel": true
},
{
"name": "LC709203F: Battery Cell Percent",
"isI2C": true,
"type": "lc709203f:unitless-percent",
"period": 30,
"i2cAddress": 11,
"sensorType": "unitless-percent"
},
{
"name": "LC709203F: Battery Cell Voltage",
"isI2C": true,
"type": "lc709203f:voltage",
"period": 30,
"i2cAddress": 11,
"sensorType": "voltage"
},
{
"name": "MAX17048/MAX17049: Battery Cell Percent",
"isI2C": true,
"type": "max17048:unitless-percent",
"period": 30,
"i2cAddress": 54,
"sensorType": "unitless-percent"
},
{
"name": "MAX17048/MAX17049: Battery Cell Voltage",
"isI2C": true,
"type": "max17048:voltage",
"period": 30,
"i2cAddress": 54,
"sensorType": "voltage"
}
]
}
7 changes: 4 additions & 3 deletions boards/feather-esp32s2-tft/definition.json
Expand Up @@ -4,15 +4,16 @@
"mcuRefVoltage": 2.6,
"displayName": "Adafruit ESP32-S2 TFT Feather",
"vendor": "Adafruit",
"productPageURL": "https://www.adafruit.com/product/5300",
"productURL": "https://www.adafruit.com/product/5300",
"documentationURL": "https://learn.adafruit.com/adafruit-esp32-s2-tft-feather",
"installMethod": "uf2",
"components": {
"digitalPins": [
{
"name": "D0",
"displayName": "D0 (Boot Btn)",
"dataType": "bool"
"displayName": "D0 (Boot Push Button)",
"dataType": "bool",
"direction":"INPUT"
},
{
"name": "D1",
Expand Down