controllers

package
v0.0.0-...-ab164db Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMapFromUpdateStatusRequest

func CreateMapFromUpdateStatusRequest(req UpdateStatusRequest) returnMap

CreateMapFromUpdateStatusRequest converts the UpdateStatusRequest struct to a map

Types

type Humidity

type Humidity struct {
	HumidityValue float64 `json:"hVl"`
	Temperature   float64 `json:"tVl"`
	SensorPin     int     `json:"seP"`
	SensorName    string  `json:"seN"`
}

type Moisture

type Moisture struct {
	MoistureValue float64 `json:"vl"`
	SensorPin     int     `json:"seP"`
	LEDpin        int     `json:"leP"`
	SensorName    string  `json:"seN"`
}

type Repository

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

func NewRepository

func NewRepository(ctx *contexts.Resource, db *db.DBClient) *Repository

func (Repository) MessageUpdateStatus

func (r Repository) MessageUpdateStatus(msg mqtt.Message) error

type Switch

type Switch struct {
	Value bool   `json:"vl"`
	ID    int    `json:"id"`
	Uuid  string `json:"uuid"`
	Pin   int    `json:"swP"`
	Name  string `json:"swN"`
}

type UpdateStatusRequest

type UpdateStatusRequest struct {
	MoistureValue float64    `json:"moistureValue"`
	Mode          string     `json:"mode"`
	Moistures     []Moisture `json:"moistures"`
	Switches      []Switch   `json:"switchs"`
	Humidities    []Humidity `json:"humidities"`
}

Jump to

Keyboard shortcuts

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