cmd

package
v0.0.0-...-391253a Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: GPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultServiceName = "GoSungrow"
	DefaultServiceArea = "Roof"
	DefaultVendor      = "MickMake"
)
View Source
const (
	OptionLogLevel      = "loglevel"
	OptionFetchSchedule = "fetchschedule"
	OptionSleepDelay    = "sleepdelay"
	OptionServiceState  = "servicestate"
)
View Source
const (
	ArgsDateInterval = "[YYYYmmdd[HHMMSS] | .] [YYYYmmdd[HHMMSS] | .] [interval | .]"
)
View Source
const DefaultMqttFile = `` /* 305-byte string literal not displayed */

Variables

This section is empty.

Functions

func Execute

func Execute() error

func MinimumArraySize

func MinimumArraySize(count int, args []string) []string

Types

type CmdApi

type CmdApi struct {
	CmdDefault

	// iSolarCloud api
	ApiTimeout   time.Duration
	Url          string
	Username     string
	Password     string
	AppKey       string
	LastLogin    string
	ApiToken     string
	ApiTokenFile string
	OutputType   string
	SaveFile     bool
	Directory    string

	SunGrow *iSolarCloud.SunGrow
}

func NewCmdApi

func NewCmdApi() *CmdApi

func (*CmdApi) ApiLogin

func (c *CmdApi) ApiLogin(force bool) error

func (*CmdApi) AttachCommand

func (c *CmdApi) AttachCommand(cmd *cobra.Command) *cobra.Command

func (*CmdApi) AttachFlags

func (c *CmdApi) AttachFlags(cmd *cobra.Command, viper *viper.Viper)

func (*CmdApi) CmdApi

func (c *CmdApi) CmdApi(cmd *cobra.Command, args []string)

func (*CmdApi) CmdApiGet

func (c *CmdApi) CmdApiGet(_ *cobra.Command, args []string) error

func (*CmdApi) CmdApiList

func (c *CmdApi) CmdApiList(cmd *cobra.Command, args []string)

func (*CmdApi) CmdApiPut

func (c *CmdApi) CmdApiPut(_ *cobra.Command, _ []string)

type CmdData

type CmdData CmdDefault

func NewCmdData

func NewCmdData() *CmdData

func (*CmdData) AttachCommand

func (c *CmdData) AttachCommand(cmd *cobra.Command) *cobra.Command

func (*CmdData) GetEndpoints

func (c *CmdData) GetEndpoints(cmd *cobra.Command, args []string) error

type CmdDefault

type CmdDefault struct {
	Error error

	SelfCmd *cobra.Command
	// contains filtered or unexported fields
}

type CmdHa

type CmdHa CmdDefault

func NewCmdHa

func NewCmdHa() *CmdHa

func (*CmdHa) AttachCommand

func (c *CmdHa) AttachCommand(cmd *cobra.Command) *cobra.Command

func (*CmdHa) CmdLovelace

func (c *CmdHa) CmdLovelace(cmd *cobra.Command, args []string) error

type CmdInfo

type CmdInfo CmdDefault

func NewCmdInfo

func NewCmdInfo() *CmdInfo

func (*CmdInfo) AttachCommand

func (c *CmdInfo) AttachCommand(cmd *cobra.Command) *cobra.Command

type CmdModbus

type CmdModbus struct {
	CmdDefault

	Username string
	Password string
	Host     string
	Port     string

	Client cmdModbus.Modbus
	// contains filtered or unexported fields
}

func NewCmdModbus

func NewCmdModbus(logLevel string) *CmdModbus

func (*CmdModbus) AttachCommand

func (c *CmdModbus) AttachCommand(cmd *cobra.Command) *cobra.Command

func (*CmdModbus) AttachFlags

func (c *CmdModbus) AttachFlags(cmd *cobra.Command, viper *viper.Viper)

func (*CmdModbus) CmdModbus

func (c *CmdModbus) CmdModbus(cmd *cobra.Command, _ []string) error

func (*CmdModbus) CmdModbusGet

func (c *CmdModbus) CmdModbusGet(_ *cobra.Command, args []string) error

func (*CmdModbus) CmdModbusScan

func (c *CmdModbus) CmdModbusScan(_ *cobra.Command, args []string) error

func (*CmdModbus) ModbusArgs

func (c *CmdModbus) ModbusArgs(_ *cobra.Command, _ []string) error

type CmdMqtt

type CmdMqtt struct {
	CmdDefault

	// HASSIO MQTT
	Username string
	Password string
	Host     string
	Port     string

	Client *cmdHassio.Mqtt
	// contains filtered or unexported fields
}

func NewCmdMqtt

func NewCmdMqtt(logLevel string) *CmdMqtt

func (*CmdMqtt) AttachCommand

func (c *CmdMqtt) AttachCommand(cmd *cobra.Command) *cobra.Command

func (*CmdMqtt) AttachFlags

func (c *CmdMqtt) AttachFlags(cmd *cobra.Command, viper *viper.Viper)

func (*CmdMqtt) CmdMqtt

func (c *CmdMqtt) CmdMqtt(cmd *cobra.Command, _ []string) error

func (*CmdMqtt) CmdMqttRun

func (c *CmdMqtt) CmdMqttRun(_ *cobra.Command, _ []string) error

func (*CmdMqtt) CmdMqttSync

func (c *CmdMqtt) CmdMqttSync(_ *cobra.Command, args []string) error

func (*CmdMqtt) Cron

func (c *CmdMqtt) Cron() error

func (*CmdMqtt) GetEndPoints

func (c *CmdMqtt) GetEndPoints() error

func (*CmdMqtt) GetFetchSchedule

func (c *CmdMqtt) GetFetchSchedule() string

func (*CmdMqtt) GetSleepDelay

func (c *CmdMqtt) GetSleepDelay() string

func (*CmdMqtt) MqttArgs

func (c *CmdMqtt) MqttArgs(_ *cobra.Command, _ []string) error

func (*CmdMqtt) Options

func (c *CmdMqtt) Options() error

func (*CmdMqtt) Update

func (c *CmdMqtt) Update(endpoint string, data api.DataMap, newDay bool) error

func (*CmdMqtt) UpdatePoint

func (c *CmdMqtt) UpdatePoint(entry *api.DataEntry) error

UpdatePoint - Set Point values to something resembling sanity based off the points metadata.

type CmdShow

type CmdShow CmdDefault

func NewCmdShow

func NewCmdShow() *CmdShow

func (*CmdShow) AttachCommand

func (c *CmdShow) AttachCommand(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachDevice

func (c *CmdShow) AttachDevice(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachDeviceData

func (c *CmdShow) AttachDeviceData(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachDeviceGraph

func (c *CmdShow) AttachDeviceGraph(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachDeviceList

func (c *CmdShow) AttachDeviceList(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachDeviceModels

func (c *CmdShow) AttachDeviceModels(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachDevicePoints

func (c *CmdShow) AttachDevicePoints(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachDeviceSave

func (c *CmdShow) AttachDeviceSave(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachMeta

func (c *CmdShow) AttachMeta(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachMetaMqtt

func (c *CmdShow) AttachMetaMqtt(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachMetaRealTime

func (c *CmdShow) AttachMetaRealTime(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachMetaUnitList

func (c *CmdShow) AttachMetaUnitList(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPoint

func (c *CmdShow) AttachPoint(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointData

func (c *CmdShow) AttachPointData(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointDevice

func (c *CmdShow) AttachPointDevice(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointDeviceGraph

func (c *CmdShow) AttachPointDeviceGraph(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointDeviceSave

func (c *CmdShow) AttachPointDeviceSave(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointDeviceTable

func (c *CmdShow) AttachPointDeviceTable(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointGraph

func (c *CmdShow) AttachPointGraph(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointPs

func (c *CmdShow) AttachPointPs(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointPsGraph

func (c *CmdShow) AttachPointPsGraph(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointPsSave

func (c *CmdShow) AttachPointPsSave(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointPsTable

func (c *CmdShow) AttachPointPsTable(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointSave

func (c *CmdShow) AttachPointSave(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointScan

func (c *CmdShow) AttachPointScan(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointTemplate

func (c *CmdShow) AttachPointTemplate(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointTemplateGraph

func (c *CmdShow) AttachPointTemplateGraph(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointTemplateSave

func (c *CmdShow) AttachPointTemplateSave(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPointTemplateTable

func (c *CmdShow) AttachPointTemplateTable(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPs

func (c *CmdShow) AttachPs(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPsData

func (c *CmdShow) AttachPsData(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPsDetail

func (c *CmdShow) AttachPsDetail(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPsGraph

func (c *CmdShow) AttachPsGraph(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPsIdList2

func (c *CmdShow) AttachPsIdList2(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPsList

func (c *CmdShow) AttachPsList(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPsPoints

func (c *CmdShow) AttachPsPoints(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPsSave

func (c *CmdShow) AttachPsSave(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachPsTree

func (c *CmdShow) AttachPsTree(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachTemplate

func (c *CmdShow) AttachTemplate(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachTemplateData

func (c *CmdShow) AttachTemplateData(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachTemplateGraph

func (c *CmdShow) AttachTemplateGraph(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachTemplateList

func (c *CmdShow) AttachTemplateList(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachTemplatePoints

func (c *CmdShow) AttachTemplatePoints(cmd *cobra.Command) *cobra.Command

func (*CmdShow) AttachTemplateSave

func (c *CmdShow) AttachTemplateSave(cmd *cobra.Command) *cobra.Command

type Cmds

type Cmds struct {
	Unify  *Unify.Unify
	Api    *CmdApi
	Data   *CmdData
	Info   *CmdInfo
	Show   *CmdShow
	Mqtt   *CmdMqtt
	Ha     *CmdHa
	Modbus *CmdModbus

	ConfigDir   string
	CacheDir    string
	ConfigFile  string
	WriteConfig bool
	Quiet       bool
	Debug       bool

	Args []string

	Error error
}

func (*Cmds) ProcessArgs

func (ca *Cmds) ProcessArgs(_ *cobra.Command, args []string) error

func (*Cmds) SetOutputType

func (ca *Cmds) SetOutputType(cmd *cobra.Command) error

func (*Cmds) SunGrowArgs

func (ca *Cmds) SunGrowArgs(cmd *cobra.Command, args []string) error

type MqttEndPoint

type MqttEndPoint struct {
	Include []string `json:"include"`
	Exclude []string `json:"exclude"`
}

type MqttEndPoints

type MqttEndPoints map[string]MqttEndPoint

func (*MqttEndPoints) IsOK

func (c *MqttEndPoints) IsOK(check *api.DataEntry) bool

func (*MqttEndPoints) Names

func (c *MqttEndPoints) Names() []string

Jump to

Keyboard shortcuts

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