Config UI: make messengers configurable (#26946)
Co-authored-by: andig <cpuidle@gmail.com> Co-authored-by: andig <andi@evcc.io> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> Co-authored-by: Michael Geers <michael@geers.tv>
This commit is contained in:
parent
66c31118ad
commit
7f772bad73
60 changed files with 1547 additions and 363 deletions
|
|
@ -291,3 +291,8 @@ type Circuit interface {
|
|||
type Redactor interface {
|
||||
Redacted() any
|
||||
}
|
||||
|
||||
// Messenger implements message sending
|
||||
type Messenger interface {
|
||||
Send(title, msg string)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,34 +34,35 @@ const (
|
|||
)
|
||||
|
||||
type All struct {
|
||||
Network Network
|
||||
Ocpp ocpp.Config
|
||||
Log string
|
||||
SponsorToken string
|
||||
Plant string // telemetry plant id
|
||||
Telemetry bool
|
||||
Mcp bool
|
||||
Metrics bool
|
||||
Profile bool
|
||||
Levels map[string]string
|
||||
Interval time.Duration
|
||||
Database DB
|
||||
Mqtt Mqtt
|
||||
ModbusProxy []ModbusProxy
|
||||
Javascript []Javascript
|
||||
Go []Go
|
||||
Influx Influx
|
||||
EEBus eebus.Config
|
||||
HEMS Hems
|
||||
SHM shm.Config
|
||||
Messaging Messaging
|
||||
Meters []config.Named
|
||||
Chargers []config.Named
|
||||
Vehicles []config.Named
|
||||
Tariffs Tariffs
|
||||
Site map[string]any
|
||||
Loadpoints []config.Named
|
||||
Circuits []config.Named
|
||||
Network Network
|
||||
Ocpp ocpp.Config
|
||||
Log string
|
||||
SponsorToken string
|
||||
Plant string // telemetry plant id
|
||||
Telemetry bool
|
||||
Mcp bool
|
||||
Metrics bool
|
||||
Profile bool
|
||||
Levels map[string]string
|
||||
Interval time.Duration
|
||||
Database DB
|
||||
Mqtt Mqtt
|
||||
ModbusProxy []ModbusProxy
|
||||
Javascript []Javascript
|
||||
Go []Go
|
||||
Influx Influx
|
||||
EEBus eebus.Config
|
||||
HEMS Hems
|
||||
SHM shm.Config
|
||||
Messaging Messaging
|
||||
MessagingEvents MessagingEvents
|
||||
Meters []config.Named
|
||||
Chargers []config.Named
|
||||
Vehicles []config.Named
|
||||
Tariffs Tariffs
|
||||
Site map[string]any
|
||||
Loadpoints []config.Named
|
||||
Circuits []config.Named
|
||||
}
|
||||
|
||||
type Javascript struct {
|
||||
|
|
@ -146,13 +147,17 @@ type DB struct {
|
|||
}
|
||||
|
||||
type Messaging struct {
|
||||
Events map[string]MessagingEventTemplate
|
||||
Events MessagingEvents
|
||||
Services []config.Typed
|
||||
}
|
||||
|
||||
type MessagingEvents = map[string]MessagingEventTemplate
|
||||
|
||||
// MessagingEventTemplate is the push message configuration for an event
|
||||
type MessagingEventTemplate struct {
|
||||
Title, Msg string
|
||||
Title string `json:"title"`
|
||||
Msg string `json:"msg"`
|
||||
Disabled bool `json:"disabled"`
|
||||
}
|
||||
|
||||
func (c Messaging) IsConfigured() bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue