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

@ -141,6 +141,28 @@ export default function DeviceWizard(props: Props) {
</MenuItem>
</Tooltip>
)}
{selectedPort &&
// selectedPort.addressType === quack.AddressType.ADDRESS_TYPE_CONFIGURABLE_PIN_ARRAY &&
// device.featureSupported("detectOneWire") &&
selectedPort.autoDetectable && (
<Tooltip title="Used to tell the Device to scan this port for any plugged in sensors">
<MenuItem
key={"scanOneWire"}
disabled={scanInProgress || buttonClicked}
onClick={() => {
setButtonClicked(true)
console.log(selectedPort)
deviceAPI.detectOneWire(device.id(), selectedPort.address)
.then(resp => {
openSnack("Device will scan port on next check-in")
}).catch(err => {
openSnack("Command failed to send to device")
})
}}>
Scan Port
</MenuItem>
</Tooltip>
)}
{portComponents.length > 0 && (
<List>
<ListSubheader>Current Components</ListSubheader>