11// SPDX-License-Identifier: MIT
2- // Copyright (c) 2022-2023 The Pybricks Authors
2+ // Copyright (c) 2022-2025 The Pybricks Authors
33
44import './bootloaderInstructions.scss' ;
55import { Callout , Intent } from '@blueprintjs/core' ;
@@ -117,7 +117,11 @@ const BootloaderInstructions: React.FunctionComponent<BootloaderInstructionsProp
117117 const { button, light, lightPattern } = useMemo ( ( ) => {
118118 return {
119119 button : i18n . translate (
120- hubHasBluetoothButton ( hubType ) ? 'button.bluetooth' : 'button.power' ,
120+ hubType === Hub . EV3
121+ ? 'button.right'
122+ : hubHasBluetoothButton ( hubType )
123+ ? 'button.bluetooth'
124+ : 'button.power' ,
121125 ) ,
122126 light : i18n . translate (
123127 hubHasBluetoothButton ( hubType ) ? 'light.bluetooth' : 'light.status' ,
@@ -163,13 +167,16 @@ const BootloaderInstructions: React.FunctionComponent<BootloaderInstructionsProp
163167 const prepareSteps = useMemo (
164168 ( ) => (
165169 < >
166- < li >
167- { i18n . translate (
168- hubHasUSB ( hubType )
169- ? 'instructionGroup.prepare.usb'
170- : 'instructionGroup.prepare.batteries' ,
171- ) }
172- </ li >
170+ { hubType !== Hub . EV3 && (
171+ < li >
172+ { i18n . translate (
173+ hubHasUSB ( hubType )
174+ ? 'instructionGroup.prepare.usb'
175+ : 'instructionGroup.prepare.batteries' ,
176+ ) }
177+ </ li >
178+ ) }
179+
173180 < li > { i18n . translate ( 'instructionGroup.prepare.turnOff' ) } </ li >
174181 { /* For non-usb recovery, show step about official app */ }
175182 { recovery && ! hubHasUSB ( hubType ) && (
@@ -179,6 +186,12 @@ const BootloaderInstructions: React.FunctionComponent<BootloaderInstructionsProp
179186 } ) }
180187 </ li >
181188 ) }
189+
190+ { hubType === Hub . EV3 && (
191+ < li >
192+ { i18n . translate ( 'instructionGroup.bootloaderMode.connectUsb' ) }
193+ </ li >
194+ ) }
182195 </ >
183196 ) ,
184197 [ i18n , recovery , hubType ] ,
@@ -210,28 +223,36 @@ const BootloaderInstructions: React.FunctionComponent<BootloaderInstructionsProp
210223
211224 { /* not strictly necessary, but order is swapped in the video,
212225 so we match it here. */ }
213- { hubType !== Hub . Essential && hubHasUSB ( hubType ) && (
226+ { ( hubType === Hub . Prime || hubType === Hub . Inventor ) &&
227+ hubHasUSB ( hubType ) && (
228+ < li
229+ className = { classNames (
230+ activeStep === 'connect-usb' && 'pb-active-step' ,
231+ ) }
232+ >
233+ { i18n . translate (
234+ 'instructionGroup.bootloaderMode.connectUsb' ,
235+ ) }
236+ </ li >
237+ ) }
238+
239+ { hubType !== Hub . EV3 && (
214240 < li
215241 className = { classNames (
216- activeStep === 'connect-usb ' && 'pb-active-step' ,
242+ activeStep === 'wait-for-light ' && 'pb-active-step' ,
217243 ) }
218244 >
219- { i18n . translate ( 'instructionGroup.bootloaderMode.connectUsb' ) }
245+ { i18n . translate (
246+ 'instructionGroup.bootloaderMode.waitForLight' ,
247+ {
248+ button,
249+ light,
250+ lightPattern,
251+ } ,
252+ ) }
220253 </ li >
221254 ) }
222255
223- < li
224- className = { classNames (
225- activeStep === 'wait-for-light' && 'pb-active-step' ,
226- ) }
227- >
228- { i18n . translate ( 'instructionGroup.bootloaderMode.waitForLight' , {
229- button,
230- light,
231- lightPattern,
232- } ) }
233- </ li >
234-
235256 { hubType === Hub . Essential && hubHasUSB ( hubType ) && (
236257 < li
237258 className = { classNames (
@@ -242,6 +263,18 @@ const BootloaderInstructions: React.FunctionComponent<BootloaderInstructionsProp
242263 </ li >
243264 ) }
244265
266+ { hubType === Hub . EV3 && (
267+ < li
268+ className = { classNames (
269+ activeStep === 'press-power-button' && 'pb-active-step' ,
270+ ) }
271+ >
272+ { i18n . translate (
273+ 'instructionGroup.bootloaderMode.pressPowerButtonEV3' ,
274+ ) }
275+ </ li >
276+ ) }
277+
245278 { recovery && ! hubHasUSB ( hubType ) && (
246279 < li
247280 className = { classNames (
@@ -262,7 +295,9 @@ const BootloaderInstructions: React.FunctionComponent<BootloaderInstructionsProp
262295 ) }
263296 >
264297 { i18n . translate (
265- 'instructionGroup.bootloaderMode.releaseButton' ,
298+ hubType === Hub . EV3
299+ ? 'instructionGroup.bootloaderMode.releaseButtonsEV3'
300+ : 'instructionGroup.bootloaderMode.releaseButton' ,
266301 {
267302 button,
268303 } ,
@@ -342,6 +377,13 @@ const BootloaderInstructions: React.FunctionComponent<BootloaderInstructionsProp
342377 1
343378 }
344379 >
380+ { hubType === Hub . EV3 && (
381+ < li >
382+ { i18n . translate (
383+ 'instructionGroup.connect.selectEV3FirmwareType' ,
384+ ) }
385+ </ li >
386+ ) }
345387 < li >
346388 { i18n . translate (
347389 'instructionGroup.connect.clickConnectAndFlash' ,
@@ -389,7 +431,7 @@ const BootloaderInstructions: React.FunctionComponent<BootloaderInstructionsProp
389431 </ Callout >
390432 ) }
391433
392- { hubHasUSB ( hubType ) && isWindows ( ) && (
434+ { hubHasUSB ( hubType ) && hubType !== Hub . EV3 && isWindows ( ) && (
393435 < Callout intent = { Intent . WARNING } icon = { < WarningSign /> } >
394436 { i18n . translate ( 'warning.windows.message' , {
395437 instructions : (
0 commit comments