Merge branch 'onewire_detect' into staging_environment

This commit is contained in:
csawatzky 2025-12-15 16:33:54 -06:00
commit a7fee2f76d
13 changed files with 380 additions and 24 deletions

View file

@ -1,4 +1,4 @@
import { Button, Card, Divider, List, ListItem, Typography } from "@mui/material";
import { Box, Button, Card, Divider, List, ListItem, Typography } from "@mui/material";
import Grid from '@mui/material/Grid2';
import { Component, Device, Interaction, User } from "models";
import { getContextKeys, getContextTypes } from "pbHelpers/Context";
@ -169,8 +169,9 @@ export default function DevicePage() {
const loadPortScan = () => {
deviceAPI.listFoundComponents(parseInt(deviceID))
.then(resp => {
if (resp.data.foundComponents?.i2c){
setScannedAddresses(resp.data.foundComponents ?? undefined)
console.log(resp.data)
if (resp.data.foundComponents?.i2c || resp.data.foundComponents?.oneWire){
setScannedAddresses(pond.ListFoundComponentsResponse.fromObject(resp.data).foundComponents ?? undefined)
}
})
.catch(err => {
@ -411,7 +412,16 @@ export default function DevicePage() {
/>
</Grid>
{/* add grid card here for I2C detected components */}
{(scannedAddresses?.i2c || scannedAddresses?.oneWire) &&
<Grid size={{ xs: 12 }}>
<DeviceScannedComponents
scannedComponents={scannedAddresses}
device={device}
availablePositions={availablePositions}
availableOffsets={availableOffsets}
refreshCallback={loadDevice}/>
</Grid>
}
{diagnosticComponents.map(comp => (
<Grid size={{ xs: 12 }} key={comp.key()}>
<ComponentDiagnostics
@ -432,8 +442,8 @@ export default function DevicePage() {
refreshCallback={loadDevice}
/>
</Grid>
{scannedAddresses &&
<Grid size={{ xs: 6, sm: 6, lg: 4, xl: 4 }}>
{(scannedAddresses?.i2c || scannedAddresses?.oneWire) &&
<Grid size={{ xs: 6, sm: 6, lg: 8, xl: 8 }}>
<DeviceScannedComponents
scannedComponents={scannedAddresses}
device={device}