openpdu/src/main.go

38 lines
654 B
Go
Raw Normal View History

2020-12-23 09:11:11 +00:00
package main
import (
2021-01-09 18:38:57 +00:00
"git.openpdu.org/OpenPDU/openpdu/syslog"
"git.openpdu.org/OpenPDU/openpdu/ups"
"git.openpdu.org/OpenPDU/openpdu/webui"
2020-12-23 09:11:11 +00:00
"github.com/spf13/viper"
)
func init() {
viper.SetDefault("system.hostname", "openpdu")
}
2020-12-23 09:11:11 +00:00
func main() {
CreateBoards()
CreateOutlets()
2021-01-09 18:38:57 +00:00
InitBoards()
MQTTSetup()
go MQTTRefreshLoop()
go ups.UpsConnect()
2021-01-19 09:39:35 +00:00
go displayLoop()
2021-01-09 18:38:57 +00:00
syslog.Info("hostname: " + viper.GetString("system.hostname"))
webui.StartServer()
2020-12-23 09:11:11 +00:00
}
// https://github.com/ColorlibHQ/AdminLTE/archive/v2.4.17.tar.gz
/* TODO
- config reset gpio
- classi per board
- classi per outlet
- fai funzionare toggle
- scan i2c
- impostazioni log
*/