@printhive/bambu-models 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +78 -2
- package/dist/index.d.ts +23 -0
- package/dist/index.js +23 -0
- package/dist/model.d.ts +41 -0
- package/dist/model.js +2 -0
- package/dist/models.d.ts +204 -0
- package/dist/models.js +199 -0
- package/package.json +53 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PrintHive
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,79 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @printhive/bambu-models
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Bambu Lab printer models, their identity and their hardware, with a source for every fact.
|
|
4
|
+
|
|
5
|
+
- Look a printer up by its SSDP model code, serial number, MQTT `printer_type`, or reported product name.
|
|
6
|
+
- Every value carries `{ value, source, ref }`, so a reader can see where a fact came from and re-check it.
|
|
7
|
+
- A missing field means unknown, never false.
|
|
8
|
+
- No runtime dependencies: plain data and types.
|
|
9
|
+
|
|
10
|
+
[@printhive/lanscout](https://github.com/PrintHive/lanscout) and @printhive/bambu use it. It covers what a printer is, not how its firmware talks.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install @printhive/bambu-models
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Use it
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { modelByCode, modelBySerial, models } from "@printhive/bambu-models"
|
|
22
|
+
|
|
23
|
+
const id = modelByCode("C12") // "P1S"
|
|
24
|
+
const printer = id && models[id]
|
|
25
|
+
|
|
26
|
+
printer?.camera?.value // "jpeg-tls-6000"
|
|
27
|
+
printer?.camera?.source // "community-mit"
|
|
28
|
+
printer?.camera?.ref // where to check it
|
|
29
|
+
|
|
30
|
+
modelBySerial("01P00C000000000") // "P1S"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`ModelId` is the union of the table's keys, such as `"X1C"` or `"H2DPRO"`. `ModelCode` is the union of every model code in the table, such as `"C12"` or `"BL-P001"`. Code keyed by `ModelId` fails to compile when a model is missing.
|
|
34
|
+
|
|
35
|
+
## Fields
|
|
36
|
+
|
|
37
|
+
| Field | Meaning |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `name` | Marketing name, such as `X1-Carbon` |
|
|
40
|
+
| `productName` | The `product_name` the printer reports in its module list, such as `Bambu Lab P1S` |
|
|
41
|
+
| `shortName` | PrintHive's short token, such as `A1M` or `H2D Pro` |
|
|
42
|
+
| `family` | `A1`, `A2`, `H2`, `P1`, `P2`, `X1`, or `X2` |
|
|
43
|
+
| `modelCodes` | SSDP `DevModel.bambu.com` values, also the cloud's `dev_model_name` |
|
|
44
|
+
| `serialPrefixes` | First three characters of the serial number |
|
|
45
|
+
| `printerTypes` | MQTT `print.printer_type` values |
|
|
46
|
+
| `extruders` | 1 or 2 |
|
|
47
|
+
| `amsKindsSeen` | AMS kinds seen attached to the model. Not exhaustive |
|
|
48
|
+
| `chamberSensor` | `real`, `placeholder`, or `none` |
|
|
49
|
+
| `chamberHeating` | Whether the chamber is actively heated |
|
|
50
|
+
| `camera` | `rtsps-322`, `jpeg-tls-6000`, or `none` |
|
|
51
|
+
| `ftps` | The FTPS port |
|
|
52
|
+
|
|
53
|
+
## Sources
|
|
54
|
+
|
|
55
|
+
Every fact comes from one of these, named in its `source`:
|
|
56
|
+
|
|
57
|
+
| Source | What it is |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `tape` | PrintHive's own captures from real printers |
|
|
60
|
+
| `community-mit` | [pybambu](https://github.com/greghesp/ha-bambulab) in ha-bambulab, MIT, pinned at `0e027ff` |
|
|
61
|
+
| `openbambuapi` | Facts documented by [OpenBambuAPI](https://github.com/Doridian/OpenBambuAPI), GFDL-1.3, pinned at `cc383a2` |
|
|
62
|
+
| `vendor-doc` | Bambu Lab's own published documentation |
|
|
63
|
+
| `inferred` | PrintHive conventions, such as the short names |
|
|
64
|
+
|
|
65
|
+
The table never copies from or derives from AGPL or GPL projects, such as BambuStudio or OrcaSlicer. Those may be used only to cross-check a fact that already has a clean source.
|
|
66
|
+
|
|
67
|
+
Model codes, serial prefixes, and `printer_type` values are known for only some models so far. Each fact is added when a capture or a clean source confirms it.
|
|
68
|
+
|
|
69
|
+
## Develop
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
bun install
|
|
73
|
+
bun run check
|
|
74
|
+
bun run build
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { models } from "./models.ts";
|
|
2
|
+
export type { AmsKind, Camera, ChamberSensor, Family, Model, Source, Sourced } from "./model.ts";
|
|
3
|
+
export { models };
|
|
4
|
+
export type ModelId = keyof typeof models;
|
|
5
|
+
type CodesOf<K extends ModelId> = (typeof models)[K] extends {
|
|
6
|
+
readonly modelCodes: {
|
|
7
|
+
readonly value: ReadonlyArray<infer C>;
|
|
8
|
+
};
|
|
9
|
+
} ? C : never;
|
|
10
|
+
/** Every SSDP `DevModel.bambu.com` value in the table, as a literal union. */
|
|
11
|
+
export type ModelCode = {
|
|
12
|
+
readonly [K in ModelId]: CodesOf<K>;
|
|
13
|
+
}[ModelId];
|
|
14
|
+
export declare const modelIds: ReadonlyArray<ModelId>;
|
|
15
|
+
/** The model with this SSDP `DevModel.bambu.com` code, such as `C12`. */
|
|
16
|
+
export declare const modelByCode: (code: string) => ModelId | undefined;
|
|
17
|
+
/** The model whose serials start like this one. */
|
|
18
|
+
export declare const modelBySerial: (serial: string) => ModelId | undefined;
|
|
19
|
+
/** The model with this MQTT `print.printer_type`. */
|
|
20
|
+
export declare const modelByPrinterType: (printerType: string) => ModelId | undefined;
|
|
21
|
+
/** The model whose module list reports this `product_name`, such as `Bambu Lab H2D`. */
|
|
22
|
+
export declare const modelByProductName: (productName: string) => ModelId | undefined;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { models } from "./models.js";
|
|
2
|
+
export { models };
|
|
3
|
+
export const modelIds = Object.keys(models).filter((id) => Object.hasOwn(models, id));
|
|
4
|
+
const index = (values) => {
|
|
5
|
+
const out = new Map();
|
|
6
|
+
for (const id of modelIds)
|
|
7
|
+
for (const value of values(models[id]) ?? [])
|
|
8
|
+
out.set(value, id);
|
|
9
|
+
return out;
|
|
10
|
+
};
|
|
11
|
+
const byModelCode = index((m) => m.modelCodes?.value);
|
|
12
|
+
const bySerialPrefix = index((m) => m.serialPrefixes?.value);
|
|
13
|
+
const byPrinterType = index((m) => m.printerTypes?.value);
|
|
14
|
+
const byProductName = index((m) => (m.productName ? [m.productName.value] : undefined));
|
|
15
|
+
/** The model with this SSDP `DevModel.bambu.com` code, such as `C12`. */
|
|
16
|
+
export const modelByCode = (code) => byModelCode.get(code);
|
|
17
|
+
/** The model whose serials start like this one. */
|
|
18
|
+
export const modelBySerial = (serial) => bySerialPrefix.get(serial.slice(0, 3).toUpperCase());
|
|
19
|
+
/** The model with this MQTT `print.printer_type`. */
|
|
20
|
+
export const modelByPrinterType = (printerType) => byPrinterType.get(printerType);
|
|
21
|
+
/** The model whose module list reports this `product_name`, such as `Bambu Lab H2D`. */
|
|
22
|
+
export const modelByProductName = (productName) => byProductName.get(productName);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
package/dist/model.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Where a fact comes from. Every fact in the table carries one, with a `ref` precise enough to re-check it. */
|
|
2
|
+
export type Source = "tape" | "vendor-doc" | "community-mit" | "openbambuapi" | "inferred";
|
|
3
|
+
export interface Sourced<A> {
|
|
4
|
+
readonly value: A;
|
|
5
|
+
readonly source: Source;
|
|
6
|
+
readonly ref: string;
|
|
7
|
+
}
|
|
8
|
+
export type Family = "A1" | "A2" | "H2" | "P1" | "P2" | "X1" | "X2";
|
|
9
|
+
/** `rtsps-322` is an RTSPS stream on port 322; `jpeg-tls-6000` is a JPEG frame stream over TLS on port 6000. */
|
|
10
|
+
export type Camera = "rtsps-322" | "jpeg-tls-6000" | "none";
|
|
11
|
+
export type ChamberSensor = "real" | "placeholder" | "none";
|
|
12
|
+
export type AmsKind = "AMS" | "AMS 2 Pro" | "AMS HT" | "AMS lite";
|
|
13
|
+
/**
|
|
14
|
+
* What a Bambu Lab printer model is: its identity and hardware. How its firmware talks belongs elsewhere.
|
|
15
|
+
*
|
|
16
|
+
* A missing field means unknown, never false or none. A field is present only when a source affirms it.
|
|
17
|
+
*/
|
|
18
|
+
export interface Model {
|
|
19
|
+
readonly name: Sourced<string>;
|
|
20
|
+
/** The `product_name` the printer reports for itself in its module list, such as `Bambu Lab P1S`. */
|
|
21
|
+
readonly productName?: Sourced<string>;
|
|
22
|
+
/** The short token PrintHive uses for the model, such as `A1M` or `H2D Pro`. */
|
|
23
|
+
readonly shortName: Sourced<string>;
|
|
24
|
+
readonly family: Sourced<Family>;
|
|
25
|
+
/** SSDP `DevModel.bambu.com` values, which the cloud API also reports as `dev_model_name`. */
|
|
26
|
+
readonly modelCodes?: Sourced<ReadonlyArray<string>>;
|
|
27
|
+
/** The first three characters of the serial number. */
|
|
28
|
+
readonly serialPrefixes?: Sourced<ReadonlyArray<string>>;
|
|
29
|
+
/** MQTT `print.printer_type` values. */
|
|
30
|
+
readonly printerTypes?: Sourced<ReadonlyArray<string>>;
|
|
31
|
+
readonly extruders?: Sourced<1 | 2>;
|
|
32
|
+
/** AMS kinds seen attached to this model. Not exhaustive: a kind absent here is unknown, not unsupported. */
|
|
33
|
+
readonly amsKindsSeen?: Sourced<ReadonlyArray<AmsKind>>;
|
|
34
|
+
readonly chamberSensor?: Sourced<ChamberSensor>;
|
|
35
|
+
readonly chamberHeating?: Sourced<boolean>;
|
|
36
|
+
readonly camera?: Sourced<Camera>;
|
|
37
|
+
readonly ftps?: Sourced<{
|
|
38
|
+
readonly port: 990;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=model.d.ts.map
|
package/dist/model.js
ADDED
package/dist/models.d.ts
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import type { AmsKind, Camera, Family, Sourced } from "./model.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Every Bambu Lab printer model known to PrintHive, keyed by a stable id. Built only from PrintHive's own captures
|
|
4
|
+
* and permissively licensed or factual sources; see each fact's `ref`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const models: {
|
|
7
|
+
readonly A1: {
|
|
8
|
+
readonly name: Sourced<string>;
|
|
9
|
+
readonly productName: Sourced<`Bambu Lab ${string}`>;
|
|
10
|
+
readonly shortName: Sourced<string>;
|
|
11
|
+
readonly family: Sourced<Family>;
|
|
12
|
+
readonly modelCodes: Sourced<readonly ["N2S"]>;
|
|
13
|
+
readonly serialPrefixes: Sourced<readonly ["039"]>;
|
|
14
|
+
readonly extruders: Sourced<1>;
|
|
15
|
+
readonly chamberSensor: Sourced<"none">;
|
|
16
|
+
readonly chamberHeating: Sourced<false>;
|
|
17
|
+
readonly camera: Sourced<Camera>;
|
|
18
|
+
readonly ftps: Sourced<{
|
|
19
|
+
readonly port: 990;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
readonly A1M: {
|
|
23
|
+
readonly name: Sourced<string>;
|
|
24
|
+
readonly productName: Sourced<`Bambu Lab ${string}`>;
|
|
25
|
+
readonly shortName: Sourced<string>;
|
|
26
|
+
readonly family: Sourced<Family>;
|
|
27
|
+
readonly modelCodes: Sourced<readonly ["N1"]>;
|
|
28
|
+
readonly extruders: Sourced<1>;
|
|
29
|
+
readonly chamberSensor: Sourced<"none">;
|
|
30
|
+
readonly chamberHeating: Sourced<false>;
|
|
31
|
+
readonly camera: Sourced<Camera>;
|
|
32
|
+
readonly ftps: Sourced<{
|
|
33
|
+
readonly port: 990;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
readonly A2L: {
|
|
37
|
+
readonly name: Sourced<string>;
|
|
38
|
+
readonly productName: Sourced<`Bambu Lab ${string}`>;
|
|
39
|
+
readonly shortName: Sourced<string>;
|
|
40
|
+
readonly family: Sourced<Family>;
|
|
41
|
+
readonly extruders: Sourced<1>;
|
|
42
|
+
readonly amsKindsSeen: Sourced<readonly AmsKind[]>;
|
|
43
|
+
readonly chamberSensor: Sourced<"none">;
|
|
44
|
+
readonly chamberHeating: Sourced<false>;
|
|
45
|
+
readonly camera: Sourced<Camera>;
|
|
46
|
+
readonly ftps: Sourced<{
|
|
47
|
+
readonly port: 990;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
readonly P1P: {
|
|
51
|
+
readonly name: Sourced<string>;
|
|
52
|
+
readonly productName: Sourced<`Bambu Lab ${string}`>;
|
|
53
|
+
readonly shortName: Sourced<string>;
|
|
54
|
+
readonly family: Sourced<Family>;
|
|
55
|
+
readonly modelCodes: Sourced<readonly ["C11"]>;
|
|
56
|
+
readonly extruders: Sourced<1>;
|
|
57
|
+
readonly chamberHeating: Sourced<false>;
|
|
58
|
+
readonly camera: Sourced<Camera>;
|
|
59
|
+
readonly ftps: Sourced<{
|
|
60
|
+
readonly port: 990;
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
63
|
+
readonly P1S: {
|
|
64
|
+
readonly name: Sourced<string>;
|
|
65
|
+
readonly productName: Sourced<`Bambu Lab ${string}`>;
|
|
66
|
+
readonly shortName: Sourced<string>;
|
|
67
|
+
readonly family: Sourced<Family>;
|
|
68
|
+
readonly modelCodes: Sourced<readonly ["C12"]>;
|
|
69
|
+
readonly serialPrefixes: Sourced<readonly ["01P"]>;
|
|
70
|
+
readonly extruders: Sourced<1>;
|
|
71
|
+
readonly chamberHeating: Sourced<false>;
|
|
72
|
+
readonly camera: Sourced<Camera>;
|
|
73
|
+
readonly ftps: Sourced<{
|
|
74
|
+
readonly port: 990;
|
|
75
|
+
}>;
|
|
76
|
+
};
|
|
77
|
+
readonly P2S: {
|
|
78
|
+
readonly name: Sourced<string>;
|
|
79
|
+
readonly productName: Sourced<`Bambu Lab ${string}`>;
|
|
80
|
+
readonly shortName: Sourced<string>;
|
|
81
|
+
readonly family: Sourced<Family>;
|
|
82
|
+
readonly extruders: Sourced<1>;
|
|
83
|
+
readonly amsKindsSeen: Sourced<readonly AmsKind[]>;
|
|
84
|
+
readonly chamberSensor: Sourced<"real">;
|
|
85
|
+
readonly chamberHeating: Sourced<false>;
|
|
86
|
+
readonly camera: Sourced<Camera>;
|
|
87
|
+
readonly ftps: Sourced<{
|
|
88
|
+
readonly port: 990;
|
|
89
|
+
}>;
|
|
90
|
+
};
|
|
91
|
+
readonly H2C: {
|
|
92
|
+
readonly name: Sourced<string>;
|
|
93
|
+
readonly productName: Sourced<`Bambu Lab ${string}`>;
|
|
94
|
+
readonly shortName: Sourced<string>;
|
|
95
|
+
readonly family: Sourced<Family>;
|
|
96
|
+
readonly extruders: Sourced<2>;
|
|
97
|
+
readonly amsKindsSeen: Sourced<readonly AmsKind[]>;
|
|
98
|
+
readonly chamberSensor: Sourced<"real">;
|
|
99
|
+
readonly chamberHeating: Sourced<true>;
|
|
100
|
+
readonly camera: Sourced<Camera>;
|
|
101
|
+
readonly ftps: Sourced<{
|
|
102
|
+
readonly port: 990;
|
|
103
|
+
}>;
|
|
104
|
+
};
|
|
105
|
+
readonly H2D: {
|
|
106
|
+
readonly name: Sourced<string>;
|
|
107
|
+
readonly productName: Sourced<`Bambu Lab ${string}`>;
|
|
108
|
+
readonly shortName: Sourced<string>;
|
|
109
|
+
readonly family: Sourced<Family>;
|
|
110
|
+
readonly modelCodes: Sourced<readonly ["O1D"]>;
|
|
111
|
+
readonly serialPrefixes: Sourced<readonly ["094"]>;
|
|
112
|
+
readonly extruders: Sourced<2>;
|
|
113
|
+
readonly amsKindsSeen: Sourced<readonly AmsKind[]>;
|
|
114
|
+
readonly chamberSensor: Sourced<"real">;
|
|
115
|
+
readonly chamberHeating: Sourced<true>;
|
|
116
|
+
readonly camera: Sourced<Camera>;
|
|
117
|
+
readonly ftps: Sourced<{
|
|
118
|
+
readonly port: 990;
|
|
119
|
+
}>;
|
|
120
|
+
};
|
|
121
|
+
readonly H2DPRO: {
|
|
122
|
+
readonly name: Sourced<string>;
|
|
123
|
+
readonly productName: Sourced<`Bambu Lab ${string}`>;
|
|
124
|
+
readonly shortName: Sourced<string>;
|
|
125
|
+
readonly family: Sourced<Family>;
|
|
126
|
+
readonly extruders: Sourced<2>;
|
|
127
|
+
readonly amsKindsSeen: Sourced<readonly AmsKind[]>;
|
|
128
|
+
readonly chamberSensor: Sourced<"real">;
|
|
129
|
+
readonly chamberHeating: Sourced<true>;
|
|
130
|
+
readonly camera: Sourced<Camera>;
|
|
131
|
+
readonly ftps: Sourced<{
|
|
132
|
+
readonly port: 990;
|
|
133
|
+
}>;
|
|
134
|
+
};
|
|
135
|
+
readonly H2S: {
|
|
136
|
+
readonly name: Sourced<string>;
|
|
137
|
+
readonly productName: Sourced<`Bambu Lab ${string}`>;
|
|
138
|
+
readonly shortName: Sourced<string>;
|
|
139
|
+
readonly family: Sourced<Family>;
|
|
140
|
+
readonly extruders: Sourced<1>;
|
|
141
|
+
readonly amsKindsSeen: Sourced<readonly AmsKind[]>;
|
|
142
|
+
readonly chamberSensor: Sourced<"real">;
|
|
143
|
+
readonly chamberHeating: Sourced<true>;
|
|
144
|
+
readonly camera: Sourced<Camera>;
|
|
145
|
+
readonly ftps: Sourced<{
|
|
146
|
+
readonly port: 990;
|
|
147
|
+
}>;
|
|
148
|
+
};
|
|
149
|
+
readonly X1: {
|
|
150
|
+
readonly name: Sourced<"X1">;
|
|
151
|
+
readonly shortName: Sourced<string>;
|
|
152
|
+
readonly family: Sourced<Family>;
|
|
153
|
+
readonly extruders: Sourced<1>;
|
|
154
|
+
readonly chamberSensor: Sourced<"real">;
|
|
155
|
+
readonly chamberHeating: Sourced<false>;
|
|
156
|
+
readonly camera: Sourced<Camera>;
|
|
157
|
+
readonly ftps: Sourced<{
|
|
158
|
+
readonly port: 990;
|
|
159
|
+
}>;
|
|
160
|
+
};
|
|
161
|
+
readonly X1C: {
|
|
162
|
+
readonly name: Sourced<"X1-Carbon">;
|
|
163
|
+
readonly productName: Sourced<"Bambu Lab X1-Carbon">;
|
|
164
|
+
readonly shortName: Sourced<string>;
|
|
165
|
+
readonly family: Sourced<Family>;
|
|
166
|
+
readonly modelCodes: Sourced<readonly ["BL-P001"]>;
|
|
167
|
+
readonly serialPrefixes: Sourced<readonly ["00M"]>;
|
|
168
|
+
readonly extruders: Sourced<1>;
|
|
169
|
+
readonly amsKindsSeen: Sourced<readonly AmsKind[]>;
|
|
170
|
+
readonly chamberSensor: Sourced<"real">;
|
|
171
|
+
readonly chamberHeating: Sourced<false>;
|
|
172
|
+
readonly camera: Sourced<Camera>;
|
|
173
|
+
readonly ftps: Sourced<{
|
|
174
|
+
readonly port: 990;
|
|
175
|
+
}>;
|
|
176
|
+
};
|
|
177
|
+
readonly X1E: {
|
|
178
|
+
readonly name: Sourced<"X1E">;
|
|
179
|
+
readonly shortName: Sourced<string>;
|
|
180
|
+
readonly family: Sourced<Family>;
|
|
181
|
+
readonly extruders: Sourced<1>;
|
|
182
|
+
readonly chamberSensor: Sourced<"real">;
|
|
183
|
+
readonly chamberHeating: Sourced<true>;
|
|
184
|
+
readonly camera: Sourced<Camera>;
|
|
185
|
+
readonly ftps: Sourced<{
|
|
186
|
+
readonly port: 990;
|
|
187
|
+
}>;
|
|
188
|
+
};
|
|
189
|
+
readonly X2D: {
|
|
190
|
+
readonly name: Sourced<string>;
|
|
191
|
+
readonly productName: Sourced<`Bambu Lab ${string}`>;
|
|
192
|
+
readonly shortName: Sourced<string>;
|
|
193
|
+
readonly family: Sourced<Family>;
|
|
194
|
+
readonly extruders: Sourced<2>;
|
|
195
|
+
readonly amsKindsSeen: Sourced<readonly AmsKind[]>;
|
|
196
|
+
readonly chamberSensor: Sourced<"real">;
|
|
197
|
+
readonly chamberHeating: Sourced<true>;
|
|
198
|
+
readonly camera: Sourced<Camera>;
|
|
199
|
+
readonly ftps: Sourced<{
|
|
200
|
+
readonly port: 990;
|
|
201
|
+
}>;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
//# sourceMappingURL=models.d.ts.map
|
package/dist/models.js
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/** ha-bambulab's pybambu, MIT. */
|
|
2
|
+
const PYBAMBU = "greghesp/ha-bambulab@0e027ff, custom_components/bambu_lab/pybambu";
|
|
3
|
+
/** OpenBambuAPI, GFDL-1.3; only facts are used. */
|
|
4
|
+
const OPENBAMBUAPI = "Doridian/OpenBambuAPI@cc383a2";
|
|
5
|
+
/** PrintHive's own LAN capture: SSDP `DevModel.bambu.com` and the serial in each printer's MQTT TLS certificate. */
|
|
6
|
+
const TAPE = "PrintHive LAN capture 2026-10-28, lanscout SSDP and TLS certificate";
|
|
7
|
+
const fact = (value, source, ref) => ({ value, source, ref });
|
|
8
|
+
const pybambu = (value, ref) => fact(value, "community-mit", `${PYBAMBU}/${ref}`);
|
|
9
|
+
const openBambuApi = (value, ref) => fact(value, "openbambuapi", `${OPENBAMBUAPI}/${ref}`);
|
|
10
|
+
const tape = (value) => fact(value, "tape", TAPE);
|
|
11
|
+
const short = (value) => fact(value, "inferred", "PrintHive short names");
|
|
12
|
+
const product = (name) => pybambu(`Bambu Lab ${name}`, "utils.py get_printer_type product_map");
|
|
13
|
+
const named = (name) => pybambu(name, "utils.py get_printer_type product_map");
|
|
14
|
+
const family = (value) => pybambu(value, "models.py supports_feature model groups");
|
|
15
|
+
const single = pybambu(1, "models.py supports_feature DUAL_NOZZLES");
|
|
16
|
+
const dual = pybambu(2, "models.py supports_feature DUAL_NOZZLES");
|
|
17
|
+
const rtsps = fact("rtsps-322", "community-mit", `${PYBAMBU}/models.py supports_feature CAMERA_RTSP; port 322 per ${OPENBAMBUAPI}/video.md`);
|
|
18
|
+
const jpeg = fact("jpeg-tls-6000", "community-mit", `${PYBAMBU}/models.py supports_feature CAMERA_IMAGE; port 6000 per ${OPENBAMBUAPI}/video.md`);
|
|
19
|
+
const chamberReal = pybambu("real", "models.py supports_feature CHAMBER_TEMPERATURE");
|
|
20
|
+
const chamberNone = pybambu("none", "models.py supports_feature CHAMBER_TEMPERATURE");
|
|
21
|
+
const heated = pybambu(true, "models.py supports_feature ACTIVE_CHAMBER_HEATER");
|
|
22
|
+
const unheated = pybambu(false, "models.py supports_feature ACTIVE_CHAMBER_HEATER");
|
|
23
|
+
const ftps = openBambuApi({ port: 990 }, "ftp.md");
|
|
24
|
+
const ams = (kinds, mock) => pybambu(kinds, `mock_data/${mock} AMS product_name`);
|
|
25
|
+
/**
|
|
26
|
+
* Every Bambu Lab printer model known to PrintHive, keyed by a stable id. Built only from PrintHive's own captures
|
|
27
|
+
* and permissively licensed or factual sources; see each fact's `ref`.
|
|
28
|
+
*/
|
|
29
|
+
export const models = {
|
|
30
|
+
A1: {
|
|
31
|
+
name: named("A1"),
|
|
32
|
+
productName: product("A1"),
|
|
33
|
+
shortName: short("A1"),
|
|
34
|
+
family: family("A1"),
|
|
35
|
+
modelCodes: fact(["N2S"], "tape", `${TAPE}; also ${PYBAMBU}/utils.py get_printer_type project_name`),
|
|
36
|
+
serialPrefixes: tape(["039"]),
|
|
37
|
+
extruders: single,
|
|
38
|
+
chamberSensor: chamberNone,
|
|
39
|
+
chamberHeating: unheated,
|
|
40
|
+
camera: jpeg,
|
|
41
|
+
ftps
|
|
42
|
+
},
|
|
43
|
+
A1M: {
|
|
44
|
+
name: named("A1 mini"),
|
|
45
|
+
productName: product("A1 mini"),
|
|
46
|
+
shortName: short("A1M"),
|
|
47
|
+
family: family("A1"),
|
|
48
|
+
modelCodes: pybambu(["N1"], "utils.py get_printer_type project_name"),
|
|
49
|
+
extruders: single,
|
|
50
|
+
chamberSensor: chamberNone,
|
|
51
|
+
chamberHeating: unheated,
|
|
52
|
+
camera: jpeg,
|
|
53
|
+
ftps
|
|
54
|
+
},
|
|
55
|
+
A2L: {
|
|
56
|
+
name: named("A2L"),
|
|
57
|
+
productName: product("A2L"),
|
|
58
|
+
shortName: short("A2L"),
|
|
59
|
+
family: family("A2"),
|
|
60
|
+
extruders: single,
|
|
61
|
+
amsKindsSeen: ams(["AMS lite"], "MOCK-A2L.json"),
|
|
62
|
+
chamberSensor: chamberNone,
|
|
63
|
+
chamberHeating: unheated,
|
|
64
|
+
camera: jpeg,
|
|
65
|
+
ftps
|
|
66
|
+
},
|
|
67
|
+
P1P: {
|
|
68
|
+
name: named("P1P"),
|
|
69
|
+
productName: product("P1P"),
|
|
70
|
+
shortName: short("P1P"),
|
|
71
|
+
family: family("P1"),
|
|
72
|
+
modelCodes: pybambu(["C11"], "utils.py get_printer_type project_name"),
|
|
73
|
+
extruders: single,
|
|
74
|
+
chamberHeating: unheated,
|
|
75
|
+
camera: jpeg,
|
|
76
|
+
ftps
|
|
77
|
+
},
|
|
78
|
+
P1S: {
|
|
79
|
+
name: named("P1S"),
|
|
80
|
+
productName: product("P1S"),
|
|
81
|
+
shortName: short("P1S"),
|
|
82
|
+
family: family("P1"),
|
|
83
|
+
modelCodes: fact(["C12"], "tape", `${TAPE}; also ${PYBAMBU}/utils.py get_printer_type project_name`),
|
|
84
|
+
serialPrefixes: tape(["01P"]),
|
|
85
|
+
extruders: single,
|
|
86
|
+
chamberHeating: unheated,
|
|
87
|
+
camera: jpeg,
|
|
88
|
+
ftps
|
|
89
|
+
},
|
|
90
|
+
P2S: {
|
|
91
|
+
name: named("P2S"),
|
|
92
|
+
productName: product("P2S"),
|
|
93
|
+
shortName: short("P2S"),
|
|
94
|
+
family: family("P2"),
|
|
95
|
+
extruders: single,
|
|
96
|
+
amsKindsSeen: ams(["AMS 2 Pro"], "MOCK-P2S.json"),
|
|
97
|
+
chamberSensor: chamberReal,
|
|
98
|
+
chamberHeating: unheated,
|
|
99
|
+
camera: rtsps,
|
|
100
|
+
ftps
|
|
101
|
+
},
|
|
102
|
+
H2C: {
|
|
103
|
+
name: named("H2C"),
|
|
104
|
+
productName: product("H2C"),
|
|
105
|
+
shortName: short("H2C"),
|
|
106
|
+
family: family("H2"),
|
|
107
|
+
extruders: dual,
|
|
108
|
+
amsKindsSeen: ams(["AMS 2 Pro"], "MOCK-H2C.json"),
|
|
109
|
+
chamberSensor: chamberReal,
|
|
110
|
+
chamberHeating: heated,
|
|
111
|
+
camera: rtsps,
|
|
112
|
+
ftps
|
|
113
|
+
},
|
|
114
|
+
H2D: {
|
|
115
|
+
name: named("H2D"),
|
|
116
|
+
productName: product("H2D"),
|
|
117
|
+
shortName: short("H2D"),
|
|
118
|
+
family: family("H2"),
|
|
119
|
+
modelCodes: tape(["O1D"]),
|
|
120
|
+
serialPrefixes: tape(["094"]),
|
|
121
|
+
extruders: dual,
|
|
122
|
+
amsKindsSeen: ams(["AMS", "AMS 2 Pro", "AMS HT"], "MOCK-H2DEXTSPOOLACTIVE.json"),
|
|
123
|
+
chamberSensor: chamberReal,
|
|
124
|
+
chamberHeating: heated,
|
|
125
|
+
camera: rtsps,
|
|
126
|
+
ftps
|
|
127
|
+
},
|
|
128
|
+
H2DPRO: {
|
|
129
|
+
name: named("H2D Pro"),
|
|
130
|
+
productName: product("H2D Pro"),
|
|
131
|
+
shortName: short("H2D Pro"),
|
|
132
|
+
family: family("H2"),
|
|
133
|
+
extruders: dual,
|
|
134
|
+
amsKindsSeen: ams(["AMS 2 Pro", "AMS HT"], "MOCK-H2DPRO.json"),
|
|
135
|
+
chamberSensor: chamberReal,
|
|
136
|
+
chamberHeating: heated,
|
|
137
|
+
camera: rtsps,
|
|
138
|
+
ftps
|
|
139
|
+
},
|
|
140
|
+
H2S: {
|
|
141
|
+
name: named("H2S"),
|
|
142
|
+
productName: product("H2S"),
|
|
143
|
+
shortName: short("H2S"),
|
|
144
|
+
family: family("H2"),
|
|
145
|
+
extruders: single,
|
|
146
|
+
amsKindsSeen: ams(["AMS 2 Pro"], "MOCK-H2S.json"),
|
|
147
|
+
chamberSensor: chamberReal,
|
|
148
|
+
chamberHeating: heated,
|
|
149
|
+
camera: rtsps,
|
|
150
|
+
ftps
|
|
151
|
+
},
|
|
152
|
+
X1: {
|
|
153
|
+
name: pybambu("X1", "const.py Printers"),
|
|
154
|
+
shortName: short("X1"),
|
|
155
|
+
family: family("X1"),
|
|
156
|
+
extruders: single,
|
|
157
|
+
chamberSensor: chamberReal,
|
|
158
|
+
chamberHeating: unheated,
|
|
159
|
+
camera: rtsps,
|
|
160
|
+
ftps
|
|
161
|
+
},
|
|
162
|
+
X1C: {
|
|
163
|
+
name: pybambu("X1-Carbon", "mock_data/MOCK-X1CMULTIAMS.json product_name"),
|
|
164
|
+
productName: pybambu("Bambu Lab X1-Carbon", "mock_data/MOCK-X1CMULTIAMS.json product_name"),
|
|
165
|
+
shortName: short("X1C"),
|
|
166
|
+
family: family("X1"),
|
|
167
|
+
modelCodes: fact(["BL-P001"], "tape", `${TAPE}; also ${PYBAMBU}/bambu_cloud.py dev_model_name`),
|
|
168
|
+
serialPrefixes: tape(["00M"]),
|
|
169
|
+
extruders: single,
|
|
170
|
+
amsKindsSeen: ams(["AMS", "AMS 2 Pro", "AMS HT"], "MOCK-X1CMULTIAMS.json"),
|
|
171
|
+
chamberSensor: chamberReal,
|
|
172
|
+
chamberHeating: unheated,
|
|
173
|
+
camera: rtsps,
|
|
174
|
+
ftps
|
|
175
|
+
},
|
|
176
|
+
X1E: {
|
|
177
|
+
name: pybambu("X1E", "const.py Printers"),
|
|
178
|
+
shortName: short("X1E"),
|
|
179
|
+
family: family("X1"),
|
|
180
|
+
extruders: single,
|
|
181
|
+
chamberSensor: chamberReal,
|
|
182
|
+
chamberHeating: heated,
|
|
183
|
+
camera: rtsps,
|
|
184
|
+
ftps
|
|
185
|
+
},
|
|
186
|
+
X2D: {
|
|
187
|
+
name: named("X2D"),
|
|
188
|
+
productName: product("X2D"),
|
|
189
|
+
shortName: short("X2D"),
|
|
190
|
+
family: family("X2"),
|
|
191
|
+
extruders: dual,
|
|
192
|
+
amsKindsSeen: ams(["AMS 2 Pro"], "MOCK-X2D.json"),
|
|
193
|
+
chamberSensor: chamberReal,
|
|
194
|
+
chamberHeating: heated,
|
|
195
|
+
camera: rtsps,
|
|
196
|
+
ftps
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
//# sourceMappingURL=models.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@printhive/bambu-models",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Bambu Lab printer models: identity and capabilities, with a source for every fact",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "PrintHive",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/PrintHive/bambu-models.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/PrintHive/bambu-models#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/PrintHive/bambu-models/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=22"
|
|
18
|
+
},
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"!dist/**/*.map",
|
|
32
|
+
"README.md",
|
|
33
|
+
"LICENSE"
|
|
34
|
+
],
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"packageManager": "bun@1.4.0",
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
41
|
+
"typecheck": "tsc --noEmit",
|
|
42
|
+
"lint": "oxlint --deny-warnings",
|
|
43
|
+
"test": "bun test",
|
|
44
|
+
"test:node": "vitest run",
|
|
45
|
+
"check": "bun run lint && bun run typecheck && bun run test",
|
|
46
|
+
"prepublishOnly": "bun run check && bun run build"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@oxlint/plugins": "1.90.0",
|
|
50
|
+
"@types/node": "^26",
|
|
51
|
+
"oxlint": "1.90.0",
|
|
52
|
+
"typescript": "^7",
|
|
53
|
+
"vitest": "^5.0.5"
|
|
54
|
+
}
|
|
55
|
+
}
|