diff --git a/package-lock.json b/package-lock.json
index afd8bad..5f23d5a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -42,7 +42,7 @@
"mui-tel-input": "^7.0.0",
"notistack": "^3.0.1",
"openweathermap-ts": "^1.2.10",
- "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#staging",
+ "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#dev",
"query-string": "^9.2.1",
"react": "^18.3.1",
"react-beautiful-dnd": "^13.1.1",
@@ -10953,7 +10953,7 @@
},
"node_modules/protobuf-ts": {
"version": "1.0.0",
- "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#c65c13a8eb98331c6648e401219debf8c9adc657",
+ "resolved": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#b230f4b2779d21ca7b502798b1472f667f8bbdc0",
"dependencies": {
"protobufjs": "^6.8.8"
}
diff --git a/src/device/DeviceWizard.tsx b/src/device/DeviceWizard.tsx
index 32387eb..6c8f361 100644
--- a/src/device/DeviceWizard.tsx
+++ b/src/device/DeviceWizard.tsx
@@ -141,6 +141,28 @@ export default function DeviceWizard(props: Props) {
)}
+ {selectedPort &&
+ // selectedPort.addressType === quack.AddressType.ADDRESS_TYPE_CONFIGURABLE_PIN_ARRAY &&
+ // device.featureSupported("detectOneWire") &&
+ selectedPort.autoDetectable && (
+
+
+
+ )}
{portComponents.length > 0 && (
Current Components
diff --git a/src/device/autoDetect/DeviceScannedComponents.tsx b/src/device/autoDetect/DeviceScannedComponents.tsx
index 0381281..e1fc020 100644
--- a/src/device/autoDetect/DeviceScannedComponents.tsx
+++ b/src/device/autoDetect/DeviceScannedComponents.tsx
@@ -7,9 +7,11 @@ import { useEffect, useState } from "react";
import ScannedI2C from "./ScannedI2C";
import ComponentForm from "component/ComponentForm";
import { Component, Device } from "models";
-import { DeviceAvailabilityMap, OffsetAvailabilityMap } from "pbHelpers/DeviceAvailability";
+import { DeviceAvailabilityMap, FindAvailablePositions, OffsetAvailabilityMap } from "pbHelpers/DeviceAvailability";
import ResponsiveDialog from "common/ResponsiveDialog";
import { useComponentAPI, useDeviceAPI, useSnackbar } from "hooks";
+import { ConfigurablePin } from "pbHelpers/AddressTypes";
+import ScannedOneWirePort from "./OneWire/ScannedOneWirePort";
interface Props {
scannedComponents: pond.ComponentAddressMap
@@ -31,7 +33,8 @@ export default function DeviceScannedComponents(props: Props){
const compAPI = useComponentAPI();
const deviceAPI = useDeviceAPI()
const [scannedI2C, setScannedI2C] = useState() //the unmodified scan of addresses
- const [validCompAddresses, setValidComponentAddresses] = useState([]) //the filtered array of address data
+ const [scannedOneWire, setScannedOneWire] = useState([])
+ const [validI2CCompAddresses, setValidI2CComponentAddresses] = useState([]) //the filtered array of address data
const [components, setComponents] = useState([])
const [steps, setSteps] = useState([]);
const { error, success } = useSnackbar();
@@ -40,8 +43,8 @@ export default function DeviceScannedComponents(props: Props){
const [openDialog, setOpenDialog] = useState(false);
useEffect(()=>{
- //console.log(scannedComponents)
if (scannedComponents.i2c) setScannedI2C(scannedComponents.i2c)
+ if (scannedComponents.oneWire) setScannedOneWire(scannedComponents.oneWire)
//makes the array empty for testing
// if (scannedComponents.i2c) {
// let clone = cloneDeep(scannedComponents.i2c)
@@ -76,7 +79,7 @@ export default function DeviceScannedComponents(props: Props){
}
})
}
- setValidComponentAddresses(valid)
+ setValidI2CComponentAddresses(valid)
},[scannedI2C])
const stepper = () => {
@@ -200,6 +203,7 @@ export default function DeviceScannedComponents(props: Props){
})
})
}
+ console.log(cloneList)
setComponents(cloneList)
}
@@ -225,7 +229,7 @@ export default function DeviceScannedComponents(props: Props){
- {validCompAddresses.length > 0 ? validCompAddresses.map((addr, index) => {
+ {validI2CCompAddresses.length > 0 ? validI2CCompAddresses.map((addr, index) => {
return (
()}/>
)
@@ -242,6 +246,38 @@ export default function DeviceScannedComponents(props: Props){
}
}
+ {scannedOneWire.length > 0 &&
+
+
+
+ Pin Port Sensors
+
+
+ {scannedOneWire.map((scan,i) => {
+ let map = FindAvailablePositions([], device.settings.product).availability.get(quack.AddressType.ADDRESS_TYPE_CONFIGURABLE_PIN_ARRAY)
+ let portAddress = scan.settings?.oneWireData?.port
+ let portLabel = ""
+
+ map?.forEach(entry => {
+ let pin = entry as ConfigurablePin
+ if (pin.address && pin.address === portAddress) {
+ portLabel = pin.label
+ }
+ })
+ return(
+
+
+ Port: {portLabel}
+
+
+
+
+ )
+ })}
+
+ }
diff --git a/src/device/autoDetect/OneWire/PortComponent.tsx b/src/device/autoDetect/OneWire/PortComponent.tsx
new file mode 100644
index 0000000..ee2ab3f
--- /dev/null
+++ b/src/device/autoDetect/OneWire/PortComponent.tsx
@@ -0,0 +1,85 @@
+import { Box, Checkbox, MenuItem, TextField, Tooltip } from "@mui/material"
+import { getFriendlyName, getSubtypes, Subtype } from "pbHelpers/ComponentType"
+import { quack } from "protobuf-ts/quack"
+import React, { useEffect, useState } from "react"
+
+interface Props {
+ compData: quack.OneWireComponentData
+ componentSelect: (selected: boolean, componentData: quack.OneWireComponentData) => void
+}
+
+export default function PortComponent(props: Props){
+ const {compData, componentSelect} = props
+ // const [selectedSubtype, setSelectedSubtype] = useState(0)
+ const [subtypeVal, setSubtypeVal] = useState("none")//note that this is the friendly name and not the key or the value because it needs to be different from the other alias options
+ const [subtypeMap, setSubtypeMap] = useState