Skip to content

Commit 9383f26

Browse files
Add tag tests
1 parent 778bd57 commit 9383f26

44 files changed

Lines changed: 591 additions & 1 deletion

Some content is hidden

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

‎.github/workflows/pytest.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: pytest
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Check out repository
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.11'
19+
cache: pip
20+
21+
- name: Install dependencies
22+
run: python -m pip install --upgrade pip && python -m pip install -r requirements.txt
23+
24+
- name: Run pytest
25+
env:
26+
FILAMENT_DETECT_TEST_CREALITY_ENCRYPTION_KEY: ${{ secrets.FILAMENT_DETECT_TEST_CREALITY_ENCRYPTION_KEY }}
27+
run: pytest

‎requirements.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
requests
22
jinja2
33
spidev
4+
cryptography
5+
pytest
6+
PyYAML
47
# libgpiod 1.6.4

‎src/tag/bambu/processor.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def process_tag(self, scan_result: ScanResult, data: bytes) -> GenericFilament |
117117
return GenericFilament(
118118
source_processor=self.name,
119119
unique_id=GenericFilament.generate_unique_id("Bambu Lab", filament_type, detailed_type, argb_color, production_datetime),
120-
manufacturer="Bambu Lab",
120+
manufacturer="Bambu",
121121
type=filament_type,
122122
modifiers=[filament_modifier] if len(filament_modifier) > 0 and filament_modifier != filament_type else [],
123123
colors=colors,
192 Bytes
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
source_processor: AnycubicTagProcessor
2+
unique_id: 7875a75162b939abae816efaefe53239daecdbfe8b7e354cd8cf25a86162cd8d
3+
manufacturer: AC
4+
type: PLA
5+
modifiers: []
6+
colors:
7+
- 0xFFC8102E
8+
diameter_mm: 1.75
9+
weight_grams: 1000
10+
hotend_min_temp_c: 190
11+
hotend_max_temp_c: 230
12+
bed_temp_c: 65
13+
drying_temp_c: 0
14+
drying_time_hours: 0
15+
manufacturing_date: "0001-01-01"
16+
td: 0.0

‎test/tags/Bambu/PETG-Basic-Red.bin‎

1 KB
Binary file not shown.

‎test/tags/Bambu/PETG-Basic-Red.yml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
source_processor: BambuTagProcessor
2+
unique_id: 016f37d1d7e9a1a5ad9dedb96e5f7160be4e4d9502776f80ae3b6ef8cdb97e61
3+
manufacturer: Bambu
4+
type: PETG
5+
modifiers:
6+
- Basic
7+
colors:
8+
- 0xFFD6001C
9+
diameter_mm: 1.75
10+
weight_grams: 1000
11+
hotend_min_temp_c: 220
12+
hotend_max_temp_c: 270
13+
bed_temp_c: 0
14+
drying_temp_c: 65
15+
drying_time_hours: 8
16+
manufacturing_date: "2023-07-31"
17+
td: 0.0

‎test/tags/Bambu/PETG-HF-Green.bin‎

1 KB
Binary file not shown.

‎test/tags/Bambu/PETG-HF-Green.yml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
source_processor: BambuTagProcessor
2+
unique_id: 1e8cde6dacac3cec8c89cb4d24480a413455206d3d469e54c8839f0eecf2804a
3+
manufacturer: Bambu
4+
type: PETG
5+
modifiers:
6+
- HF
7+
colors:
8+
- 0xFF00AE42
9+
diameter_mm: 1.75
10+
weight_grams: 1000
11+
hotend_min_temp_c: 230
12+
hotend_max_temp_c: 260
13+
bed_temp_c: 0
14+
drying_temp_c: 65
15+
drying_time_hours: 8
16+
manufacturing_date: "2026-01-22"
17+
td: 0.0
1 KB
Binary file not shown.

0 commit comments

Comments
 (0)