fix: solve issue with Antenna Genius for remote operations
This commit is contained in:
@@ -151,8 +151,9 @@ const (
|
||||
|
||||
// Antenna Genius (4O3A) antenna switch — Hardware → Antenna Genius. TCP
|
||||
// port is fixed at 9007, so only the IP is configurable.
|
||||
keyAntGeniusEnabled = "antgenius.enabled"
|
||||
keyAntGeniusHost = "antgenius.host"
|
||||
keyAntGeniusEnabled = "antgenius.enabled"
|
||||
keyAntGeniusHost = "antgenius.host"
|
||||
keyAntGeniusPassword = "antgenius.password" // remote/AUTH password (blank on LAN)
|
||||
|
||||
// PowerGenius XL (4O3A) amplifier fan-mode control — Hardware → PowerGenius.
|
||||
keyPGXLEnabled = "pgxl.enabled"
|
||||
@@ -9001,8 +9002,9 @@ func (a *App) TestUltrabeam(s UltrabeamSettings) error {
|
||||
// AntGeniusSettings is the JSON shape for the Hardware → Antenna Genius panel.
|
||||
// The TCP port is fixed at 9007 on the device, so only the IP is configurable.
|
||||
type AntGeniusSettings struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
Host string `json:"host"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Host string `json:"host"`
|
||||
Password string `json:"password"` // remote-access password; leave blank on LAN (no AUTH)
|
||||
}
|
||||
|
||||
// GetAntGeniusSettings returns the persisted Antenna Genius config.
|
||||
@@ -9011,12 +9013,13 @@ func (a *App) GetAntGeniusSettings() (AntGeniusSettings, error) {
|
||||
if a.settings == nil {
|
||||
return out, fmt.Errorf("db not initialized")
|
||||
}
|
||||
m, err := a.settings.GetMany(a.ctx, keyAntGeniusEnabled, keyAntGeniusHost)
|
||||
m, err := a.settings.GetMany(a.ctx, keyAntGeniusEnabled, keyAntGeniusHost, keyAntGeniusPassword)
|
||||
if err != nil {
|
||||
return out, err
|
||||
}
|
||||
out.Enabled = m[keyAntGeniusEnabled] == "1"
|
||||
out.Host = m[keyAntGeniusHost]
|
||||
out.Password = m[keyAntGeniusPassword]
|
||||
return out, nil
|
||||
}
|
||||
|
||||
@@ -9026,8 +9029,9 @@ func (a *App) SaveAntGeniusSettings(s AntGeniusSettings) error {
|
||||
return fmt.Errorf("db not initialized")
|
||||
}
|
||||
for k, v := range map[string]string{
|
||||
keyAntGeniusEnabled: boolStr(s.Enabled),
|
||||
keyAntGeniusHost: strings.TrimSpace(s.Host),
|
||||
keyAntGeniusEnabled: boolStr(s.Enabled),
|
||||
keyAntGeniusHost: strings.TrimSpace(s.Host),
|
||||
keyAntGeniusPassword: s.Password,
|
||||
} {
|
||||
if err := a.settings.Set(a.ctx, k, v); err != nil {
|
||||
return err
|
||||
@@ -9049,7 +9053,7 @@ func (a *App) startAntGenius() {
|
||||
if err != nil || !s.Enabled || strings.TrimSpace(s.Host) == "" {
|
||||
return
|
||||
}
|
||||
a.antgenius = antgenius.New(s.Host, 9007)
|
||||
a.antgenius = antgenius.New(s.Host, 9007, s.Password)
|
||||
_ = a.antgenius.Start()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user