From 98a153816722f7f49be1708347b67e52f465daad Mon Sep 17 00:00:00 2001 From: csawatzky Date: Thu, 23 Oct 2025 13:01:54 -0600 Subject: [PATCH 1/8] fix for the I2C Drager stuff so it uses the expansion line and not cable id so the address type stays as 2, onewire drager will still use cable id --- src/component/ComponentSettings.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/component/ComponentSettings.tsx b/src/component/ComponentSettings.tsx index a7b8877..5dd2695 100644 --- a/src/component/ComponentSettings.tsx +++ b/src/component/ComponentSettings.tsx @@ -514,7 +514,8 @@ export default function ComponentSettings(props: Props) { } const supportsExpansion = () => { - return (formComponent.settings.type === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE && + return ((formComponent.settings.type === quack.ComponentType.COMPONENT_TYPE_GRAIN_CABLE || + formComponent.settings.type === quack.ComponentType.COMPONENT_TYPE_DRAGER_GAS_DONGLE) && formComponent.settings.addressType === quack.AddressType.ADDRESS_TYPE_I2C) } From d6f33a873c8e1f292b52fc6706f2f402dbeb42d9 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Mon, 27 Oct 2025 15:11:27 -0600 Subject: [PATCH 2/8] adding ne alarm subtype to the boolean output --- package-lock.json | 2 +- package.json | 2 +- src/pbHelpers/ComponentTypes/OnOffOutput.ts | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index afd8bad..d11bc29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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#31866a5a4ebad3770b82f4687bec2fd4c3b8417e", "dependencies": { "protobufjs": "^6.8.8" } diff --git a/package.json b/package.json index ee0e9b7..fc7a1ac 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,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#master", + "protobuf-ts": "git+https://gitlab+deploy-token-50627:hv8mB4WkyvtjBpJKU1rN@gitlab.com/brandx/protobuf-ts.git#staging", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", diff --git a/src/pbHelpers/ComponentTypes/OnOffOutput.ts b/src/pbHelpers/ComponentTypes/OnOffOutput.ts index 0e83b8c..be8ec61 100644 --- a/src/pbHelpers/ComponentTypes/OnOffOutput.ts +++ b/src/pbHelpers/ComponentTypes/OnOffOutput.ts @@ -63,6 +63,11 @@ const subtypes = [ key: quack.BooleanOutputSubtype.BOOLEAN_OUTPUT_SUBTYPE_EXHAUST_FAN, value: "BOOLEAN_OUTPUT_SUBTYPE_FAN", friendlyName: "Exhaust Fan" + } as Subtype, + { + key: quack.BooleanOutputSubtype.BOOLEAN_OUTPUT_SUBTYPE_ALARM, + value: "BOOLEAN_OUTPUT_SUBTYPE_ALARM", + friendlyName: "Alarm" } as Subtype ]; From d63022ca88cd55a27f250cec2c4442f96bc219c3 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 28 Oct 2025 09:27:42 -0600 Subject: [PATCH 3/8] fix for the drager voltage showing incorrectly on the chart for o2 subtypes --- src/pbHelpers/ComponentTypes/DragerGasDongle.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pbHelpers/ComponentTypes/DragerGasDongle.ts b/src/pbHelpers/ComponentTypes/DragerGasDongle.ts index bec3b1e..dd28f75 100644 --- a/src/pbHelpers/ComponentTypes/DragerGasDongle.ts +++ b/src/pbHelpers/ComponentTypes/DragerGasDongle.ts @@ -170,6 +170,7 @@ export function dragerGasDongle(subtype: number = 0): ComponentTypeExtension { let firstTime: Moment | undefined; let lastTime: Moment | undefined; let valMap: Map = new Map(); + if(measurement.type === quack.MeasurementType.MEASUREMENT_TYPE_PPM){ measurement.values.forEach((vals, i) => { let avgVals: Point[] = []; let newLineData: LineData = { @@ -205,6 +206,14 @@ export function dragerGasDongle(subtype: number = 0): ComponentTypeExtension { valMap = new Map(); } }); + } else { + chartData = simpleLineChartData( + quack.ComponentType.COMPONENT_TYPE_DRAGER_GAS_DONGLE, + measurement, + smoothingAverages, + filters + ); + } } else { chartData = simpleLineChartData( quack.ComponentType.COMPONENT_TYPE_DRAGER_GAS_DONGLE, From 5c5d8debc45e1a1ed1b412dc0f65b7feaf5ead9e Mon Sep 17 00:00:00 2001 From: csawatzky Date: Tue, 28 Oct 2025 09:33:55 -0600 Subject: [PATCH 4/8] fix for the mV decimals on drager sensors, there shouldn't be any --- src/pbHelpers/MeasurementDescriber.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pbHelpers/MeasurementDescriber.ts b/src/pbHelpers/MeasurementDescriber.ts index 1fc2751..790b9a9 100644 --- a/src/pbHelpers/MeasurementDescriber.ts +++ b/src/pbHelpers/MeasurementDescriber.ts @@ -176,6 +176,7 @@ export class MeasurementDescriber { this.details.unit = "mV"; this.details.graph = GraphType.MULTILINE; this.details.unit = "mV"; + this.details.decimals = 0 // this.details.nodeDetails = { // colours: ["white", "black", "red", "blue"], // labels: ["millivolt1", "millivolt2", "millivolt3", "millivolt4"] From 49e8160ccf6bd2e45acac5e4d952d8f2465aca80 Mon Sep 17 00:00:00 2001 From: Carter Date: Wed, 29 Oct 2025 10:50:41 -0600 Subject: [PATCH 5/8] timestamping chat viewed timestamp when closing the header team chat --- src/app/HeaderButtons.tsx | 24 +++++++++++++++++++++++- src/app/UserWrapper.tsx | 1 + src/chat/ChatMessage.tsx | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/app/HeaderButtons.tsx b/src/app/HeaderButtons.tsx index f28151c..18e2f7d 100644 --- a/src/app/HeaderButtons.tsx +++ b/src/app/HeaderButtons.tsx @@ -8,6 +8,8 @@ import { pond } from "protobuf-ts/pond"; import { useEffect, useState } from "react"; import { getSignatureAccentColour } from "services/whiteLabel"; import NotificationDrawer from "./NotificationDrawer"; +import { useTeamAPI } from "providers"; +import { cloneDeep } from "lodash"; const useStyles = makeStyles((theme: Theme) => ({ @@ -55,7 +57,9 @@ export default function HeaderButtons(props: Props) { const [hasNewNotifications, setHasNewNotifications] = useState(false); const [chatDrawerOpen, setChatDrawerOpen] = useState(false); const [notificationDrawerOpen, setNotificationDrawerOpen] = useState(false); + const classes = useStyles(); + const teamAPI = useTeamAPI(); useEffect(() => { if (!team) return; @@ -66,6 +70,8 @@ export default function HeaderButtons(props: Props) { setHasNewChats(true); return; } + console.log(team.preferences.chatViewedTimestamp) + console.log(team.settings.lastChatTimestamp) let viewMoment = moment(team.preferences.chatViewedTimestamp); let chatMoment = moment(team.settings.lastChatTimestamp); if (viewMoment.diff(chatMoment) < 0) { @@ -154,13 +160,29 @@ export default function HeaderButtons(props: Props) { ) } + const onChatClose = () => { + setChatDrawerOpen(false) + let newTeamPrefs = cloneDeep(team.preferences) + newTeamPrefs.chatViewedTimestamp = new Date().toISOString(); + teamAPI + .updatePreferences( + team.key(), + newTeamPrefs, + // getContextKeys(), + // getContextTypes() + ) + .then(() => { + // setTeamPrefs(newTeamPrefs); + }); + } + return ( <> {chatButton()} {team && team.settings && team.settings.key && ( setChatDrawerOpen(false)} + onClose={onChatClose} team={team} /> )} diff --git a/src/app/UserWrapper.tsx b/src/app/UserWrapper.tsx index cb4cdf8..efaa7b0 100644 --- a/src/app/UserWrapper.tsx +++ b/src/app/UserWrapper.tsx @@ -72,6 +72,7 @@ export default function UserWrapper(props: Props) { if (hasFetched.current) return; setLoading(true) userAPI.getUserWithTeam(user_id).then(resp => { + console.log(resp.data.team) setGlobal({ user: resp.data.user ? User.create(resp.data.user) : User.create(), team: resp.data.team ? Team.create(resp.data.team) : Team.create(), diff --git a/src/chat/ChatMessage.tsx b/src/chat/ChatMessage.tsx index 2c26adc..ac9600b 100644 --- a/src/chat/ChatMessage.tsx +++ b/src/chat/ChatMessage.tsx @@ -75,7 +75,7 @@ export default function ChatMessage(props: Props) { return mappedPerm; // Return null for invalid keys }).filter(Boolean); // Optionally filter out any null values } else { - console.error("data.permissions is not an array or does not exist"); + // console.error("data.permissions is not an array or does not exist"); perms = []; } return perms From 1c00976ac2c167d5358122bfe2e78c92f92e5393 Mon Sep 17 00:00:00 2001 From: Carter Date: Wed, 29 Oct 2025 11:03:03 -0600 Subject: [PATCH 6/8] got rid of log --- src/app/UserWrapper.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/UserWrapper.tsx b/src/app/UserWrapper.tsx index efaa7b0..cb4cdf8 100644 --- a/src/app/UserWrapper.tsx +++ b/src/app/UserWrapper.tsx @@ -72,7 +72,6 @@ export default function UserWrapper(props: Props) { if (hasFetched.current) return; setLoading(true) userAPI.getUserWithTeam(user_id).then(resp => { - console.log(resp.data.team) setGlobal({ user: resp.data.user ? User.create(resp.data.user) : User.create(), team: resp.data.team ? Team.create(resp.data.team) : Team.create(), From af279cb2f3333bebc84534b1d05839541db7310f Mon Sep 17 00:00:00 2001 From: Carter Date: Wed, 29 Oct 2025 12:12:30 -0600 Subject: [PATCH 7/8] switched back to master proto --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fc7a1ac..ee0e9b7 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,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#master", "query-string": "^9.2.1", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", From beee7b6f2a0bf4e98d021676030f38d702825d66 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Mon, 3 Nov 2025 09:52:27 -0600 Subject: [PATCH 8/8] hotfix for putting the interactions on the component cards the interactions are loading and being added correctly but when determining which card to display the interaction on it was not considering the expansion and mux lines in the check for the same component id --- src/pages/Device.tsx | 4 +++- src/pbHelpers/Component.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/Device.tsx b/src/pages/Device.tsx index a06a173..0313373 100644 --- a/src/pages/Device.tsx +++ b/src/pages/Device.tsx @@ -252,7 +252,9 @@ export default function DevicePage() { let id: quack.IComponentID = quack.ComponentID.fromObject({ type: c.settings.type, addressType: c.settings.addressType, - address: c.settings.address + address: c.settings.address, + expansionLine: c.settings.expansionLine, + muxLine: c.settings.muxLine }); let filteredInteractions = interactions.filter(interaction => { let isSource = false; diff --git a/src/pbHelpers/Component.ts b/src/pbHelpers/Component.ts index 9329878..e809649 100644 --- a/src/pbHelpers/Component.ts +++ b/src/pbHelpers/Component.ts @@ -15,7 +15,9 @@ export function sameComponentID( const sameType: boolean = id1.type === id2.type; const sameAddressType: boolean = id1.addressType === id2.addressType; const sameAddress: boolean = (!id1.address && !id2.address) || id1.address === id2.address; - return sameType && sameAddressType && sameAddress; + const sameExpansion: boolean = (!id1.expansionLine && !id2.expansionLine) || id1.expansionLine === id2.expansionLine; + const sameMux: boolean = (!id1.muxLine && !id2.muxLine) || id1.muxLine === id2.muxLine; + return sameType && sameAddressType && sameAddress && sameExpansion && sameMux; } export function getComponentIDString(component?: Component): string {