added button to send down the onewire scan request

This commit is contained in:
csawatzky 2025-10-30 16:49:00 -06:00
parent 33eb4e6eca
commit c5a3487db0
8 changed files with 89 additions and 11 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,7 +169,8 @@ export default function DevicePage() {
const loadPortScan = () => {
deviceAPI.listFoundComponents(parseInt(deviceID))
.then(resp => {
if (resp.data.foundComponents?.i2c){
console.log(resp.data)
if (resp.data.foundComponents){
setScannedAddresses(resp.data.foundComponents ?? undefined)
}
})
@ -430,8 +431,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}