peripheral setting save

This commit is contained in:
2025-01-25 16:00:02 +01:00
parent 0114ed03bf
commit 9d00b99730
9 changed files with 70 additions and 18 deletions

View File

@@ -38,7 +38,6 @@ type FTDIPeripheral struct {
func NewFTDIPeripheral(name string, serialNumber string, location int) (*FTDIPeripheral, error) {
log.Info().Str("file", "FTDIPeripheral").Str("name", name).Str("s/n", serialNumber).Int("location", location).Msg("FTDI peripheral created")
settings := make(map[string]interface{})
settings["universesNumber"] = uint64(1)
return &FTDIPeripheral{
name: name,
dmxSender: nil,
@@ -172,6 +171,12 @@ func (p *FTDIPeripheral) Deactivate(ctx context.Context) error {
return fmt.Errorf("unable to deactivate: not connected")
}
// SetPeripheralSetting sets a specific setting for this peripheral
func (p *FTDIPeripheral) SetPeripheralSetting(settingName string, settingValue interface{}) error {
p.settings[settingName] = settingValue
return nil
}
// SetDeviceProperty sends a command to the specified device
func (p *FTDIPeripheral) SetDeviceProperty(ctx context.Context, uint32, channelNumber uint32, channelValue byte) error {
if p.dmxSender != nil {