DRY up the factory methods

use optional functions to set address functions
This commit is contained in:
2026-02-07 14:23:46 +00:00
parent 3c47d12719
commit 23422f9641
11 changed files with 99 additions and 93 deletions

View File

@@ -10,13 +10,14 @@ type Strip struct {
Comp *Comp
}
// newStrip creates a new Strip instance
func newStrip(c *Client) *Strip {
return &Strip{
client: c,
baseAddress: c.addressMap["strip"],
Gate: newGateForStrip(c, c.addressMap["strip"]),
Eq: newEqForStrip(c, c.addressMap["strip"]),
Comp: newCompForStrip(c, c.addressMap["strip"]),
Gate: newGate(c, c.addressMap["strip"]),
Eq: newEq(c, c.addressMap["strip"]),
Comp: newComp(c, c.addressMap["strip"]),
}
}