pigpiod is only on ipv6?

This commit is contained in:
legop3
2026-01-15 12:06:22 -05:00
parent d272a33dc2
commit 6c01087738
6 changed files with 12 additions and 2 deletions
+5
View File
@@ -115,6 +115,7 @@ type IRConfig struct {
Repeat int `yaml:"repeat" json:"repeat"`
GapMs int `yaml:"gapMs" json:"gapMs"`
ActiveLow bool `yaml:"activeLow" json:"activeLow"`
PigpioAddr string `yaml:"pigpioAddr" json:"pigpioAddr"`
}
type Config struct {
@@ -196,6 +197,7 @@ func LoadConfig(path string) (*Config, error) {
Repeat: 3,
GapMs: 100,
ActiveLow: true,
PigpioAddr: "localhost:8888",
},
}
if err := yaml.Unmarshal(data, &cfg); err != nil {
@@ -354,6 +356,9 @@ func validateIRConfig(cfg *IRConfig) error {
if cfg.Pin <= 0 {
return errors.New("pin must be > 0")
}
if cfg.PigpioAddr == "" {
cfg.PigpioAddr = "localhost:8888"
}
if cfg.CarrierHz <= 0 {
return errors.New("carrierHz must be > 0")
}