Skip to content

Commit fce3f1b

Browse files
committed
Lint
1 parent 35f63eb commit fce3f1b

26 files changed

+98
-113
lines changed

.github/workflows/contributors.yaml

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1+
---
12
on:
2-
push:
3-
branches:
4-
- main
5-
3+
push:
4+
branches:
5+
- main
66
jobs:
7-
contrib-readme-job:
8-
runs-on: ubuntu-latest
9-
name: A job to automate contrib in readme
10-
permissions:
11-
contents: write
12-
pull-requests: write
13-
steps:
14-
- name: Contribute List
15-
uses: akhilmhdh/[email protected]
16-
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7+
contrib-readme-job:
8+
runs-on: ubuntu-latest
9+
name: A job to automate contrib in readme
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
steps:
14+
- name: Contribute List
15+
uses: akhilmhdh/[email protected]
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pages-version.yaml

+13-15
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,37 @@
1+
---
12
name: Update Documentation Version
23
on:
34
push:
45
branches: ["main"]
56
paths:
67
- 'artifacts/manifest.json'
7-
88
jobs:
99
update-docs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout repository
1313
uses: actions/checkout@v4
1414
with:
15-
token: ${{ secrets.PAT }}
16-
15+
token: ${{ secrets.PAT }}
1716
# Replace the badge with the latest version
1817
# https://img.shields.io/badge/esp32s2-0.1.0-magenta
1918
- name: Read manifest and update docs
2019
run: |
21-
# Read version from manifest.json
22-
VERSION=$(jq -r .version artifacts/manifest.json)
23-
24-
echo "VERSION=$VERSION"
25-
sed -i 's/badge\/openspool-[^-]*-magenta/badge\/openspool-'"$VERSION"'-magenta/' docs/index.md
26-
sed -i 's/badge\/openspool-[^-]*-magenta/badge\/openspool-'"$VERSION"'-magenta/' README.md
27-
echo "docs/index.md"
28-
cat docs/index.md | grep shields.io
29-
echo "README.md"
30-
cat README.md | grep shields.io
20+
# Read version from manifest.json
21+
VERSION=$(jq -r .version artifacts/manifest.json)
3122

23+
echo "VERSION=$VERSION"
24+
sed -i 's/badge\/openspool-[^-]*-magenta/badge\/openspool-'"$VERSION"'-magenta/' docs/index.md
25+
sed -i 's/badge\/openspool-[^-]*-magenta/badge\/openspool-'"$VERSION"'-magenta/' README.md
26+
echo "docs/index.md"
27+
cat docs/index.md | grep shields.io
28+
echo "README.md"
29+
cat README.md | grep shields.io
3230
- name: Commit manifest file
3331
uses: EndBug/add-and-commit@v9
3432
with:
3533
committer_name: GitHub Actions
36-
committer_email: [email protected]
34+
committer_email: [email protected]
3735
message: Update manifest.json
3836
add: "docs/*.md README.md"
39-
push: true
37+
push: true

.github/workflows/pages.yaml

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
1+
---
12
# This workflow uses actions that are not certified by GitHub.
23
# They are provided by a third-party and are governed by
34
# separate terms of service, privacy policy, and support
45
# documentation.
56

67
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
78
name: OpenSpool.io Docs
8-
99
on:
1010
push:
1111
branches: ["main"]
1212
paths:
1313
- "docs/**"
14-
1514
# Allows you to run this workflow manually from the Actions tab
1615
workflow_dispatch:
17-
1816
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1917
permissions:
2018
contents: read
2119
pages: write
2220
id-token: write
23-
2421
# Allow one concurrent deployment
2522
concurrency:
2623
group: "pages"
2724
cancel-in-progress: true
28-
2925
jobs:
3026
# Build job
3127
build:
3228
runs-on: ubuntu-latest
3329
defaults:
34-
run:
35-
working-directory: docs
30+
run:
31+
working-directory: docs
3632
steps:
3733
- name: Checkout
3834
uses: actions/checkout@v4
@@ -43,7 +39,6 @@ jobs:
4339
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
4440
cache-version: 0 # Increment this number if you need to re-download cached gems
4541
working-directory: '${{ github.workspace }}/docs'
46-
4742
- name: Setup Pages
4843
id: pages
4944
uses: actions/configure-pages@v5
@@ -56,9 +51,7 @@ jobs:
5651
# Automatically uploads an artifact from the './_site' directory by default
5752
uses: actions/upload-pages-artifact@v3
5853
with:
59-
path: "docs/_site/"
60-
61-
54+
path: "docs/_site/"
6255
# Deployment job
6356
deploy:
6457
environment:
@@ -69,4 +62,4 @@ jobs:
6962
steps:
7063
- name: Deploy to GitHub Pages
7164
id: deployment
72-
uses: actions/deploy-pages@v4
65+
uses: actions/deploy-pages@v4

.pre-commit-config.yaml

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1+
---
12
repos:
2-
- repo: https://github.com/google/yamlfmt
3-
rev: v0.10.0
4-
hooks:
5-
- id: yamlfmt
3+
# yamllint has trouble with scalars like '- lambda: |- '
4+
# - repo: https://github.com/google/yamlfmt
5+
# rev: v0.10.0
6+
# hooks:
7+
# - id: yamlfmt
68
- repo: local
79
hooks:
810
- id: esphome-config-solo
911
name: ESPHome Compile Solo
1012
entry: bash -c 'podman run -v "$(pwd)/firmware:/data" --rm ghcr.io/esphome/esphome:2024.11.0 config /data/config-solo.yaml'
1113
language: system
1214
pass_filenames: false
15+
files: ^firmware/
1316
- id: esphome-config-ams
1417
name: ESPHome Compile AMS
1518
entry: bash -c 'podman run -v "$(pwd)/firmware:/data" --rm ghcr.io/esphome/esphome:2024.11.0 config /data/config-ams.yaml'
1619
language: system
1720
pass_filenames: false
21+
files: ^firmware/

.yamlfmt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
formatter:
2+
indent: 2
3+
line_ending: lf
4+
include_document_start: true
5+
colons: align
6+
scan_folded_as_literal: true
7+
disallow_anchors: false
8+
retain_line_breaks: true

docs/_config.yml

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1+
---
12
title: OpenSpool
23
description: Your filament wants to be free
34
theme: just-the-docs
4-
55
url: https://openspool.io
6-
76
aux_links:
8-
"Edit this page on Github":
7+
"Edit this page on Github":
98
- https://github.com/spuder/openspool
10-
119
logo: "images/OpenSpoolLogoMedium1.png"
12-
1310
favicon: "images/favicon.ico"
14-
1511
color_scheme: dark
16-
1712
plugins:
1813
- jekyll-default-layout
19-
2014
head_scripts:
2115
# https://github.com/esphome/esp-web-tools/issues/515#issuecomment-2387664391
2216
# - https://unpkg.com/@improv-wifi/[email protected]/dist/serial.min.js?module
@@ -27,12 +21,11 @@ defaults:
2721
path: "assets/js"
2822
values:
2923
js: true
30-
3124
callouts:
3225
warning:
3326
title: Warning
3427
color: red
35-
note:
28+
note:
3629
title: Note
3730
color: blue
3831
important:
@@ -42,7 +35,6 @@ callouts:
4235
title: Caution
4336
color: yellow
4437

45-
4638
# footer_content: "Copyright &copy; 2017-2020 Patrick Marsceill. Distributed by an <a href=\"https://github.com/just-the-docs/just-the-docs/tree/main/LICENSE.txt\">MIT license.</a>"
4739

4840
# # Footer "Edit this page on GitHub" link text
@@ -51,4 +43,4 @@ callouts:
5143
# gh_edit_repository: "https://github.com/just-the-docs/just-the-docs" # the github URL for your repo
5244
# gh_edit_branch: "main" # the branch that your docs is served from
5345
# # gh_edit_source: docs # the source that your files originate from
54-
# gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into the editor immediately
46+
# gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into the editor immediately

firmware/common.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
substitutions:
23
name: openspool
34
version: "0.0.0" # Keep this at 0.0.0 as github-actions will modify this file at build time

firmware/conf.d/automation.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
script:
23
- id: preview_rfid_data
34
then:
@@ -7,7 +8,7 @@ script:
78
auto pretty_json = [=]() -> std::string {
89
StaticJsonDocument<256> doc;
910
JsonObject root = doc.to<JsonObject>();
10-
11+
1112
root["protocol"] = "openspool";
1213
root["version"] = "1.0";
1314
root["brand"] = id(filament_brand).state.c_str();
@@ -82,7 +83,7 @@ script:
8283
} else {
8384
return true;
8485
}
85-
# TODO: Check if mqtt is enabled once this is merged: https://github.com/esphome/esphome/pull/7716
86+
# TODO: Check if mqtt is enabled once this is merged: https://github.com/esphome/esphome/pull/7716
8687
then:
8788
- mqtt.publish:
8889
# topic: device/${bambu_serial_number}/request

firmware/conf.d/bambu_printer.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
select:
23
#TODO: printer model is currently unused, but will be needed for setting AMS type
34
- platform: template

firmware/conf.d/button.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
binary_sensor:
23
- platform: gpio
34
id: physical_button

firmware/conf.d/debug.yaml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
---
12
# NOTE None of these metrics are available until device is connected to MQTT
23
# This feels like a bug, but not sure why
3-
44
debug:
55
update_interval: 5s
6-
76
logger:
87
level: debug
98
logs:
@@ -17,7 +16,6 @@ text_sensor:
1716
# state_topic:
1817
# # web_server:
1918
# # sorting_group_id: sorting_group_info
20-
2119
- platform: template
2220
name: "OpenSpool Version"
2321
lambda: |-
@@ -26,15 +24,13 @@ text_sensor:
2624
icon: mdi:new-box
2725
web_server:
2826
sorting_group_id: sorting_group_info
29-
3027
- platform: debug
3128
# device:
3229
# name: "Device Info"
3330
# state_topic:
3431
reset_reason:
3532
name: "Reset Reason"
3633
state_topic:
37-
3834
sensor:
3935
- platform: debug
4036
free:

firmware/conf.d/filament.yaml

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# Bambu Filament mappings
23
# Credit to WolfWithSword for figuring all these out
34
# https://gist.github.com/WolfwithSword/e3e4dc4f00629cc047b7cefd70d7b350#file-bambu_mqtt-json-L314
@@ -24,7 +25,6 @@ select:
2425
- script.execute: generate_filament_brand_code
2526
- script.execute: generate_filament_temperatures
2627
- script.execute: preview_rfid_data
27-
2828
- platform: template
2929
name: "Filament Variant"
3030
id: filament_variant
@@ -45,7 +45,6 @@ select:
4545
- script.execute: generate_filament_brand_code
4646
- script.execute: preview_rfid_data
4747
- script.execute: generate_filament_temperatures #TODO: not fully implemented for variants yet
48-
4948
- platform: template
5049
name: "Filament Brand"
5150
id: filament_brand
@@ -162,7 +161,6 @@ select:
162161
return "";
163162
}
164163
- script.execute: preview_rfid_data
165-
166164
number:
167165
- platform: template
168166
name: "Filament Min Temp"
@@ -186,7 +184,6 @@ number:
186184
on_value:
187185
then:
188186
- script.execute: preview_rfid_data
189-
190187
- platform: template
191188
name: "Filament Max Temp"
192189
id: filament_max_temp
@@ -210,7 +207,6 @@ number:
210207
on_value:
211208
then:
212209
- script.execute: preview_rfid_data
213-
214210
text_sensor:
215211
- platform: template
216212
name: "Filament Brand Code"
@@ -222,7 +218,6 @@ text_sensor:
222218
on_value:
223219
then:
224220
- script.execute: preview_rfid_data
225-
226221
- platform: template
227222
name: "Filament Color Hex"
228223
id: filament_color_hex
@@ -239,7 +234,6 @@ text_sensor:
239234
id(filament_color_hex_bambu).publish_state("");
240235
}
241236
- script.execute: preview_rfid_data
242-
243237
- platform: template
244238
name: "Filament Color Hex Bambu"
245239
id: filament_color_hex_bambu
@@ -250,7 +244,6 @@ text_sensor:
250244
on_value:
251245
then:
252246
- script.execute: preview_rfid_data
253-
254247
- platform: template
255248
name: Filament Sub Brand
256249
id: filament_sub_brand
@@ -261,7 +254,6 @@ text_sensor:
261254
on_value:
262255
then:
263256
- script.execute: preview_rfid_data
264-
265257
button:
266258
- platform: template
267259
id: upload_filament_settings

firmware/conf.d/improv.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
---
12
improv_serial:
2-
# next_url: "http://{{ip_address}}"
3+
# next_url: "http://{{ip_address}}"

0 commit comments

Comments
 (0)