added button to send down the onewire scan request
This commit is contained in:
parent
33eb4e6eca
commit
c5a3487db0
8 changed files with 89 additions and 11 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue