Skip to content

Commit

Permalink
Prepare for ESP32-C6 support (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz authored Nov 14, 2023
1 parent b3a52d4 commit a48b112
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
15 changes: 15 additions & 0 deletions src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ export type SupportedPlatforms =
| "ESP32S2"
| "ESP32S3"
| "ESP32C3"
| "ESP32C6"
| "RP2040";

export type PlatformData = {
label: string;
showInPickerTitle: boolean;
showInDeviceTypePicker: boolean;
defaultBoard: string | null;
};

Expand All @@ -23,31 +25,43 @@ export const supportedPlatforms: { [key in SupportedPlatforms]: PlatformData } =
ESP32: {
label: "ESP32",
showInPickerTitle: true,
showInDeviceTypePicker: true,
defaultBoard: "esp32dev",
},
ESP32S2: {
label: "ESP32-S2",
showInPickerTitle: true,
showInDeviceTypePicker: true,
defaultBoard: "esp32-s2-saola-1",
},
ESP32S3: {
label: "ESP32-S3",
showInPickerTitle: true,
showInDeviceTypePicker: true,
defaultBoard: "esp32-s3-devkitc-1",
},
ESP32C3: {
label: "ESP32-C3",
showInPickerTitle: true,
showInDeviceTypePicker: true,
defaultBoard: "esp32-c3-devkitm-1",
},
ESP32C6: {
label: "ESP32-C6",
showInPickerTitle: true,
showInDeviceTypePicker: false,
defaultBoard: "esp32-c6-devkitc-1",
},
ESP8266: {
label: "ESP8266",
showInPickerTitle: true,
showInDeviceTypePicker: true,
defaultBoard: "esp01_1m",
},
RP2040: {
label: "Raspberry Pi Pico W",
showInPickerTitle: false,
showInDeviceTypePicker: true,
defaultBoard: "rpipicow",
},
};
Expand All @@ -58,6 +72,7 @@ export const chipFamilyToPlatform: { [key: string]: SupportedPlatforms } = {
"ESP32-S2": "ESP32S2",
"ESP32-S3": "ESP32S3",
"ESP32-C3": "ESP32C3",
"ESP32-C6": "ESP32C6",
ESP8266: "ESP8266",
};

Expand Down
24 changes: 13 additions & 11 deletions src/wizard/wizard-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,17 +325,19 @@ export class ESPHomeWizardDialog extends LitElement {
</div>
<mwc-list class="platforms">
${Object.keys(supportedPlatforms).map(
(key) => html`
<mwc-list-item
hasMeta
.platform=${key}
@click=${this._handlePickPlatformClick}
>
<span>${supportedPlatforms[key].label}</span>
${metaChevronRight}
</mwc-list-item>
`,
${Object.keys(supportedPlatforms).map((key) =>
supportedPlatforms[key].showInDeviceTypePicker
? html`
<mwc-list-item
hasMeta
.platform=${key}
@click=${this._handlePickPlatformClick}
>
<span>${supportedPlatforms[key].label}</span>
${metaChevronRight}
</mwc-list-item>
`
: html``,
)}
</mwc-list>
Expand Down

0 comments on commit a48b112

Please sign in to comment.