normalizedpayload

package
v3.35.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package normalizedpayload implements functionality for parsing and validating normalized payload.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v3.34.3

type Action struct {
	Motion       Motion
	ContactState *string
}

Action is an action measurement.

type Air

type Air struct {
	Temperature      *float64
	RelativeHumidity *float64
	Pressure         *float64
	CO2              *float64
	LightIntensity   *float64
	Location         *string
}

Air is an air measurement.

type Measurement

type Measurement struct {
	Time     *time.Time
	Battery  *float64
	Soil     Soil
	Air      Air
	Wind     Wind
	Rain     Rain
	Water    Water
	Metering Metering
	Action   Action
	Position Position
}

Measurement is a measurement.

type Metering added in v3.34.3

type Metering struct {
	Water WaterMetering
}

Metering is a metering measurement.

type Motion added in v3.34.3

type Motion struct {
	Detected *bool
	Count    *float64
}

Motion is a motion measurement.

type ParsedMeasurement

type ParsedMeasurement struct {
	Measurement
	// ValidationErrors contains any errors that occurred during field validation.
	ValidationErrors []error
	// Valid only contains the valid fields, for which there were no validation errors.
	Valid *structpb.Struct
}

ParsedMeasurement is the result of parsing measurements with Parse.

func Parse

func Parse(measurements []*structpb.Struct) ([]ParsedMeasurement, error)

Parse parses and validates the measurements.

type Position added in v3.34.3

type Position struct {
	Latitude  *float64
	Longitude *float64
}

Position is a position measurement.

type Rain added in v3.34.3

type Rain struct {
	Intensity  *float64
	Cumulative *float64
}

Rain is a rain measurement.

type Soil added in v3.25.2

type Soil struct {
	Depth                  *float64
	Moisture               *float64
	Temperature            *float64
	ElectricalConductivity *float64
	PHLevel                *float64
	Nitrogen               *float64
	Phosphorus             *float64
	Potassium              *float64
}

Soil is an soil measurement.

type Water added in v3.34.3

type Water struct {
	Leak        *bool
	Temperature *float64
}

Water is a water measurement.

type WaterMetering added in v3.34.3

type WaterMetering struct {
	Total *float64
}

WaterMetering is a water metering measurement.

type Wind

type Wind struct {
	Speed     *float64
	Direction *float64
}

Wind is a wind measurement.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL