import * as React from "react"; import { readPin } from "../../devices/actions"; import { SensorListProps } from "./interfaces"; import { sortResourcesById } from "../../util"; import { Row, Col } from "../../ui"; import { isNumber } from "lodash"; import { ALLOWED_PIN_MODES } from "farmbot"; import { t } from "../../i18next_wrapper"; const SensorReadingDisplay = ({ label, value, mode }: { label: string, value: number | undefined, mode: number }) => { const moistureSensor = label.toLowerCase().includes("moisture") ? "moisture-sensor" : ""; return
{isNumber(value) && value >= 0 &&
500 ? -3.5 : 1.5}rem` : "7rem"}`, color: `${mode ? "" : "white"}` }}> {value}
}
; }; export function SensorList(props: SensorListProps) { const { pins, disabled } = props; return
{sortResourcesById(props.sensors).map(p => { const { label, mode, pin } = p.body; const value = (pins[pin || -1] || { value: undefined }).value; return

{pin}

; })}
; }