added the expansion line to the card for scanned components

This commit is contained in:
csawatzky 2025-08-29 13:20:51 -06:00
parent c263f16346
commit edb162614c
3 changed files with 8 additions and 7 deletions

View file

@ -40,7 +40,7 @@ export default function DeviceScannedComponents(props: Props){
const [openDialog, setOpenDialog] = useState(false);
useEffect(()=>{
console.log(scannedComponents)
//console.log(scannedComponents)
if (scannedComponents.i2c) setScannedI2C(scannedComponents.i2c)
//makes the array empty for testing
// if (scannedComponents.i2c) {

View file

@ -15,7 +15,7 @@ interface Props {
sensorNum?: number
}
export default function ScannedI2C(props: Props){
export default function ScannedI2C(props: Props){
const {addressData, deviceProduct, componentSelectionCallback, availablePositions, sensorNum} = props
const [types, setTypes] = useState<quack.ComponentType[]>([])
const [subtypeOptions, setSubtypeOptions] = useState<Array<Subtype>>([])
@ -107,6 +107,7 @@ export default function ScannedI2C(props: Props){
return (
<Box sx={{marginY: 1}}>
{sensorNum && <Typography>Sensor {sensorNum}</Typography>}
<Typography variant="caption">{addressData.expansionLine !== 0 && "Expansion Line: " + addressData.expansionLine}</Typography>
{types.length > 0 ?
<React.Fragment>
<Grid2 container direction="row" alignItems="center" justifyContent="space-between">
@ -145,7 +146,7 @@ export default function ScannedI2C(props: Props){
}}
select>
{subtypeOptions.map(s => (
<MenuItem value={s.key}>{s.friendlyName}</MenuItem>
<MenuItem key={s.key} value={s.key}>{s.friendlyName}</MenuItem>
))}
</TextField>
}