2020-12-23 09:11:11 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
// "encoding/json"
|
|
|
|
"log"
|
|
|
|
|
|
|
|
// "periph.io/x/periph"
|
|
|
|
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Dictionary aaa
|
|
|
|
type Dictionary map[string]interface{}
|
|
|
|
|
2020-12-23 14:32:05 +00:00
|
|
|
func init() {
|
|
|
|
viper.SetDefault("hostname", "openpdu")
|
|
|
|
}
|
2020-12-23 09:11:11 +00:00
|
|
|
|
2020-12-23 14:32:05 +00:00
|
|
|
func main() {
|
2020-12-23 09:11:11 +00:00
|
|
|
readConfig()
|
2020-12-23 14:32:05 +00:00
|
|
|
go mqttLoop()
|
2020-12-27 21:29:16 +00:00
|
|
|
go UpsConnect()
|
2020-12-23 14:32:05 +00:00
|
|
|
log.Printf("hostname: %v\n", viper.Get("hostname"))
|
2020-12-23 09:11:11 +00:00
|
|
|
startServer()
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
|
|
|
- impostazioni mqtt
|
|
|
|
|
|
|
|
|
|
|
|
*/
|