models

package
v0.0.0-...-720dba8 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceStatus

type DeviceStatus struct {
	DeviceId string
	Status   string
}

type FunctionUpdated

type FunctionUpdated struct {
	Id       string    `json:"id"`
	Type     string    `json:"type"`
	SubType  string    `json:"subType"`
	Location *location `json:"location,omitempty"`
	Name     string    `json:"name"`

	Counter *struct {
		Counter int  `json:"counter"`
		State   bool `json:"state"`
	} `json:"counter,omitempty"`
	Level *struct {
		Current float64  `json:"current"`
		Percent *float64 `json:"percent,omitempty"`
		Offset  *float64 `json:"offset,omitempty"`
	} `json:"level,omitempty"`
	Presence *struct {
		State bool `json:"state"`
	} `json:"presence,omitempty"`
	Timer *struct {
		StartTime time.Time      `json:"startTime"`
		EndTime   *time.Time     `json:"endTime,omitempty"`
		Duration  *time.Duration `json:"duration,omitempty"`
		State     bool           `json:"state"`
	} `json:"timer,omitempty"`
	WaterQuality *struct {
		Temperature float64   `json:"temperature"`
		Timestamp   time.Time `json:"timestamp"`
	} `json:"waterquality,omitempty"`
	Building *struct {
		Energy float64 `json:"energy"`
		Power  float64 `json:"power"`
	} `json:"building,omitempty"`
	Stopwatch *struct {
		StartTime      time.Time      `json:"startTime"`
		StopTime       *time.Time     `json:"stopTime,omitempty"`
		Duration       *time.Duration `json:"duration,omitempty"`
		State          bool           `json:"state"`
		Count          int32          `json:"count"`
		CumulativeTime time.Duration  `json:"cumulativeTime"`
	}
}

type Incident

type Incident struct {
	PersonId       string   `json:"personId"`
	Category       int      `json:"category"`
	Description    string   `json:"description"`
	MapCoordinates string   `json:"mapCoordinates"`
	Attachments    []string `json:"attachments"`
}

func NewIncident

func NewIncident(category int, description string) *Incident

func (*Incident) AtLocation

func (i *Incident) AtLocation(latitude, longitude float64) *Incident

type StatusMessage

type StatusMessage struct {
	DeviceID     string   `json:"deviceID"`
	BatteryLevel int      `json:"batteryLevel"`
	Code         int      `json:"statusCode"`
	Messages     []string `json:"statusMessages,omitempty"`
	Tenant       string   `json:"tenant"`
	Timestamp    string   `json:"timestamp"`
}

func NewStatusMessage

func NewStatusMessage(deviceID string, code int) StatusMessage

Jump to

Keyboard shortcuts

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