models

package
v0.0.0-...-3be2ed5 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateOption

type GenerateOption struct {
	// MutateOperation - Mutate Operation signal (for corona/cr-w)
	MutateOperation bool
}

GenerateOption - Optional Data for Remote Controller

type ModeData

type ModeData struct {
	Temp           float32 `json:"temp,omitempty"`
	Fan            string  `json:"fan"`
	HorizontalVane string  `json:"horizontal_vane,omitempty"`
	VerticalVane   string  `json:"vertical_vane,omitempty"`
}

ModeData - RemoteData by individual Modes.

type RemoteData

type RemoteData struct {
	Operation      bool    `json:"operation"`
	Mode           string  `json:"mode"`
	Temp           float32 `json:"temp,omitempty"`
	Fan            string  `json:"fan"`
	HorizontalVane string  `json:"horizontal_vane,omitempty"`
	VerticalVane   string  `json:"vertical_vane,omitempty"`
}

RemoteData - Scheme for Remote Controller

type State

type State struct {
	Operation bool                 `json:"operation"`
	Mode      string               `json:"mode"`
	ModeData  map[string]*ModeData `json:"mode_data"`
}

State - Scheme for State management (Database etc.)

func (*State) ToRemoteData

func (s *State) ToRemoteData() *RemoteData

ToRemoteData - Convert to RemoteData for current mode.

func (*State) ToRemoteDataByMode

func (s *State) ToRemoteDataByMode(mode string) *RemoteData

ToRemoteDataByMode - Convert State to RemoteData for provided mode.

Jump to

Keyboard shortcuts

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