Avena Webapp API - v0.0.1
    Preparing search index...

    Function sensorFormatForUnit

    • Picks the data_formats value that matches a calibrated channel's unit.

      Keeps format when its sensor type offers unit, or when format is not a known type (a custom value from KV is left alone). Otherwise returns the first sensor type that offers unit, or format unchanged when none does.

      Parameters

      • format: string | undefined

        Current data_formats entry.

      • unit: string

        Unit of the channel's calibration.

      Returns string

      The sensor type format to store.