database

package
v0.0.0-...-ec0fbdf Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddScheduleCommand

func AddScheduleCommand(scheduleCommand ScheduleCommand)

func CreateTables

func CreateTables(db *sql.DB)

func CreateTablesV2

func CreateTablesV2(db *sql.DB)

func DeleteScheduleCommand

func DeleteScheduleCommand(id int)

func LogBatteryCommand

func LogBatteryCommand(scheduleCommand ScheduleCommand)

func ParseTime

func ParseTime(timeStr string) time.Time

func Setup

func Setup()

func UpdateHomeChargeStatus

func UpdateHomeChargeStatus(homeChargeStatus HomeChargeStatus)

func UpdateScheduleCommand

func UpdateScheduleCommand(scheduleCommand ScheduleCommand)

Types

type BatteryCommand

type BatteryCommand struct {
	Id   int
	Name string
}

func GetBatteryCommands

func GetBatteryCommands() []BatteryCommand

type HomeChargeStatus

type HomeChargeStatus struct {
	Id               int
	Version          int
	WallboxAutomatic bool
}

func GetHomeChargeStatus

func GetHomeChargeStatus() (HomeChargeStatus, bool)

type InfluxClient

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

func NewInfluxClient

func NewInfluxClient(ip string, port string, token string, organisation string, productionTotalQuery string) *InfluxClient

func (*InfluxClient) InfluxProductionTotal

func (i *InfluxClient) InfluxProductionTotal() (float64, error)

type Query

type Query struct {
	ProductionTotal string
}

type ScheduleCommand

type ScheduleCommand struct {
	Id                 int
	BatteryCommandId   int
	BatteryCommandName string
	TriggerType        string
	TriggerTime        time.Time
	TriggerSOC         int
	Triggered          bool
}

func GetScheduleCommands

func GetScheduleCommands(triggered_optional ...bool) []ScheduleCommand

Jump to

Keyboard shortcuts

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