handlers

package
v0.0.0-...-396f30b Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const RawInfoSize = 9
View Source
const RawReadingSize = 13

Variables

View Source
var (
	RESTURI  string
	CLOUDURI string
	MQTTURI  string
	TOPICS   string
)
View Source
var GSDVal struct {
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

func Init

func Init(l *log.Logger, adj map[string]IAQDevice) *Adapter

func (Adapter) GetDeviceAdjust

func (a Adapter) GetDeviceAdjust(restServer string, devAdj map[string]IAQDevice) error

func (Adapter) ListenMultiple

func (a Adapter) ListenMultiple(uri *url.URL, topics map[string]byte)

func (Adapter) SendTestingData

func (a Adapter) SendTestingData(uri *url.URL)

func (Adapter) StoreUVUpdate

func (a Adapter) StoreUVUpdate(macAddress string, attribute string, pload []byte)

func (Adapter) StoreValue

func (a Adapter) StoreValue(pload []byte)

func (Adapter) ValueNumberAdjustment

func (a Adapter) ValueNumberAdjustment(f json.Number, adjust string, sign bool) string

type CEEPayLoad

type CEEPayLoad struct {
	MAC string `json:"mac"`

	SO2  json.Number `json:"so2"`
	NO2  json.Number `json:"no2"`
	O3   json.Number `json:"o3"`
	HCHO json.Number `json:"hcho"`

	CO    json.Number `json:"co"`
	TEMP  json.Number `json:"temp"`
	HUM   json.Number `json:"hum"`
	PM2P5 json.Number `json:"pm2p5"`
	PM10  json.Number `json:"pm10"`
	TVOC  json.Number `json:"tvoc"`
	CO2   json.Number `json:"co2"`
	PM100 json.Number `json:"pm100"`
	C2H2  json.Number `json:"c2h2"`
}

type IAQDevice

type IAQDevice struct {
	ID int `json:"id"`
	//IDRegion int    `json:"id_region"`
	Device string `json:"device"`

	H2SAdjust string `json:"h2s_adjust"`
	AQIAdjust string `json:"aqi_adjust"`

	SO2Adjust  string `json:"so2_adjust"`
	NO2Adjust  string `json:"no2_adjust"`
	O3Adjust   string `json:"o3_adjust"`
	HCHOAdjust string `json:"hcho_adjust"`

	PM2p5Adjust string `json:"pm2p5_adjust"`
	COAdjust    string `json:"co_adjust"`
	CO2Adjust   string `json:"co2_adjust"`
	C2H2Adjust  string `json:"c2h2_adjust"`
	HumAdjust   string `json:"hum_adjust"`
	TempAdjust  string `json:"temp_adjust"`
	TVOCAdjust  string `json:"tvoc_adjust"`
	PM10Adjust  string `json:"pm10_adjust"`
	PM100Adjust string `json:"pm100_adjust"`

	DateCreated string `json:"date_created"`
	DateUpdated string `json:"date_updated"`
}

IAQDevice structure

Jump to

Keyboard shortcuts

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