Merge branch 'i2c_detect' into dev_environment
This commit is contained in:
commit
a9b9c0c33d
1 changed files with 10 additions and 6 deletions
|
|
@ -40,6 +40,7 @@ export default function DeviceScannedComponents(props: Props){
|
||||||
const [openDialog, setOpenDialog] = useState(false);
|
const [openDialog, setOpenDialog] = useState(false);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
|
console.log(scannedComponents)
|
||||||
if (scannedComponents.i2c) setScannedI2C(scannedComponents.i2c)
|
if (scannedComponents.i2c) setScannedI2C(scannedComponents.i2c)
|
||||||
//makes the array empty for testing
|
//makes the array empty for testing
|
||||||
// if (scannedComponents.i2c) {
|
// if (scannedComponents.i2c) {
|
||||||
|
|
@ -65,13 +66,16 @@ export default function DeviceScannedComponents(props: Props){
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
let valid: quack.AddressData[] = []
|
let valid: quack.AddressData[] = []
|
||||||
//filter the address data
|
//filter the address data
|
||||||
scannedI2C?.settings?.foundAddresses.forEach(addrData => {
|
let addr = scannedI2C?.settings?.foundAddresses
|
||||||
if(!i2cBlacklistAddresses.includes(addrData.address)){
|
if(addr){
|
||||||
if(!(addrData.address === 0x71 && addrData.expansionLine === undefined)){
|
addr.forEach(addrData => {
|
||||||
valid.push(addrData)
|
if(!i2cBlacklistAddresses.includes(addrData.address)){
|
||||||
|
if(!(addrData.address === 0x71 && addrData.expansionLine === undefined)){
|
||||||
|
valid.push(addrData)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
setValidComponentAddresses(valid)
|
setValidComponentAddresses(valid)
|
||||||
},[scannedI2C])
|
},[scannedI2C])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue