re-added the product types and svgs for MiVent and Streamline

This commit is contained in:
csawatzky 2025-05-23 11:22:32 -06:00
parent 422ee9a070
commit 0223354f54
5 changed files with 1062 additions and 2 deletions

View file

@ -191,6 +191,38 @@ export const BindaptV2Automate: DeviceProductDescriber = {
// ])
};
export const StreamlineMonitor: DeviceProductDescriber = {
product: pond.DeviceProduct.DEVICE_PRODUCT_STREAMLINE_MONITOR,
label: "Streamline Monitor",
icon: (_, theme?: "light" | "dark") => {
return theme === "light" ? BindaptPlusDarkIcon : BindaptPlusLightIcon;
},
view: "controller",
tabs: getBindaptTabs(),
availability: BindaptV2MonitorAvailability
//TODO not sure what the default address map for these should be yet
// defaultAddressMap: new Map<string, string[]>([
// ["plenum", ["9-2-64"]],
// ["heatersFans", ["3-1-512"]] //refers to heaters and fans
// ])
};
export const StreamlineAutomate: DeviceProductDescriber = {
product: pond.DeviceProduct.DEVICE_PRODUCT_STREAMLINE_AUTOMATE,
label: "Streamline Automate",
icon: (_, theme?: "light" | "dark") => {
return theme === "light" ? BindaptPlusDarkIcon : BindaptPlusLightIcon;
},
view: "controller",
tabs: getBindaptTabs(),
availability: BindaptV2AutomateAvailability
//TODO not sure what the default address map for these should be yet
// defaultAddressMap: new Map<string, string[]>([
// ["plenum", ["9-2-64"]],
// ["heatersFans", ["3-1-512"]] //refers to heaters and fans
// ])
};
export function IsBindaptDevice(product?: pond.DeviceProduct): boolean {
const bindaptProducts: pond.DeviceProduct[] = [
pond.DeviceProduct.DEVICE_PRODUCT_BINDAPT_MINI,

View file

@ -11,7 +11,9 @@ import {
BindaptV2Automate,
BinHalo,
BinMonitor,
BinUltimate
BinUltimate,
StreamlineMonitor,
StreamlineAutomate
} from "./Bindapt/BindaptDescriber";
import { NexusST } from "./Nexus/NexusDescriber";
import { MiPCAV2, OmniAir } from "./OmniAir/OmniAirDescriber";
@ -19,6 +21,7 @@ import { ConfigurablePin } from "pbHelpers/AddressTypes";
import { useTheme } from "@mui/material";
import { Device } from "models";
import { or } from "utils";
import { MiVent, MiVentV2 } from "./MiVent/MiVentDescriber";
export type ProductTab = "components" | "presets";
@ -87,7 +90,11 @@ const DEVICE_PRODUCT_MAP = new Map<pond.DeviceProduct, DeviceProductDescriber>([
[pond.DeviceProduct.DEVICE_PRODUCT_BINDAPT_PLUS_MOD, BindaptPlusMod],
[pond.DeviceProduct.DEVICE_PRODUCT_BINDAPT_PLUS_PRO_MOD, BindaptPlusProMod],
[pond.DeviceProduct.DEVICE_PRODUCT_BINDAPT_V2_MONITOR, BindaptV2Monitor],
[pond.DeviceProduct.DEVICE_PRODUCT_BINDAPT_V2_AUTOMATE, BindaptV2Automate]
[pond.DeviceProduct.DEVICE_PRODUCT_BINDAPT_V2_AUTOMATE, BindaptV2Automate],
[pond.DeviceProduct.DEVICE_PRODUCT_MIVENT, MiVent],
[pond.DeviceProduct.DEVICE_PRODUCT_MIVENT_V2, MiVentV2],
[pond.DeviceProduct.DEVICE_PRODUCT_STREAMLINE_MONITOR, StreamlineMonitor],
[pond.DeviceProduct.DEVICE_PRODUCT_STREAMLINE_AUTOMATE, StreamlineAutomate]
]);
export function ListDeviceProductDescribers(): DeviceProductDescriber[] {

View file

@ -0,0 +1,61 @@
import { ConfigurablePin } from "pbHelpers/AddressTypes";
import { DeviceAvailabilityMap, DevicePositions } from "pbHelpers/DeviceAvailability";
import { quack } from "protobuf-ts/pond";
const MiVentV1Pins: ConfigurablePin[] = [
{ address: 4, label: "1" },
{ address: 8, label: "2" },
{ address: 16, label: "3" },
{ address: 512, label: "C1" },
{ address: 1024, label: "C2" }
];
export const MiVentV1Availability: DeviceAvailabilityMap = new Map<
quack.AddressType,
DevicePositions
>([
[quack.AddressType.ADDRESS_TYPE_INVALID, []],
[quack.AddressType.ADDRESS_TYPE_CONFIGURABLE_PIN_ARRAY, MiVentV1Pins],
[
quack.AddressType.ADDRESS_TYPE_I2C,
new Map<quack.ComponentType, number[]>([
[quack.ComponentType.COMPONENT_TYPE_PRESSURE, [0x18]],
[quack.ComponentType.COMPONENT_TYPE_DHT, [0x40]],
[quack.ComponentType.COMPONENT_TYPE_SEN5X, [0x69]],
[quack.ComponentType.COMPONENT_TYPE_AIRFLOW, [0x2a]]
])
],
[quack.AddressType.ADDRESS_TYPE_POWER, [0]],
[quack.AddressType.ADDRESS_TYPE_GPS, [0]],
[quack.AddressType.ADDRESS_TYPE_MODEM, [0]]
]);
/*---V2 Stuff starts here---*/
const MiVentV2Pins: ConfigurablePin[] = [
{ address: 1, label: "1" },
{ address: 2, label: "2" },
{ address: 4, label: "3" },
{ address: 256, label: "L1" },
{ address: 512, label: "L2" }
];
export const MiVentV2Availability: DeviceAvailabilityMap = new Map<
quack.AddressType,
DevicePositions
>([
[quack.AddressType.ADDRESS_TYPE_INVALID, []],
[quack.AddressType.ADDRESS_TYPE_CONFIGURABLE_PIN_ARRAY, MiVentV2Pins],
[
quack.AddressType.ADDRESS_TYPE_I2C,
new Map<quack.ComponentType, number[]>([
[quack.ComponentType.COMPONENT_TYPE_PRESSURE, [0x18]],
[quack.ComponentType.COMPONENT_TYPE_DHT, [0x40]],
[quack.ComponentType.COMPONENT_TYPE_SEN5X, [0x69]],
[quack.ComponentType.COMPONENT_TYPE_AIRFLOW, [0x2a]]
])
],
[quack.AddressType.ADDRESS_TYPE_POWER, [0]],
[quack.AddressType.ADDRESS_TYPE_GPS, [0]],
[quack.AddressType.ADDRESS_TYPE_MODEM, [0]]
]);

View file

@ -0,0 +1,29 @@
import { DeviceProductDescriber } from "products/DeviceProduct";
import { pond } from "protobuf-ts/pond";
import DeviceDarkIcon from "assets/products/Ag/device 1.png";
import DeviceLightIcon from "assets/products/Ag/device 2.png";
import { MiVentV1Availability, MiVentV2Availability } from "./MiVentAvailability";
export const MiVent: DeviceProductDescriber = {
product: pond.DeviceProduct.DEVICE_PRODUCT_MIVENT,
label: "MiVent V1",
icon: (_, theme?: "light" | "dark") => {
return theme === "light" ? DeviceDarkIcon : DeviceLightIcon;
},
view: "controller",
tabs: ["components"],
availability: MiVentV1Availability
};
/*---V2 Stuff starts here---*/
export const MiVentV2: DeviceProductDescriber = {
product: pond.DeviceProduct.DEVICE_PRODUCT_MIVENT_V2,
label: "MiVent V2",
icon: (_, theme?: "light" | "dark") => {
return theme === "light" ? DeviceDarkIcon : DeviceLightIcon;
},
view: "controller",
tabs: ["components"],
availability: MiVentV2Availability
};