func (c *Configuration) CoilsMap() (coils map[string]Coil) {
	coils = make(map[string]Coil)
	for _, coilConfig := range c.Coils {
		coils[coilConfig.Slug] = Coil{Address: coilConfig.Address, Slug: coilConfig.Slug, switchType: NO}
	}
	return
}
CoilsMap generates a reverse mapping of the Slugs back to the original coil
package modbridge
type ModbusMode string
const (
	Read      ModbusMode = "R"   
	ReadWrite            = "RW"  
	Write                = "W"   
)
type CoilConfig struct {
	Address uint16
	Mode    ModbusMode
	Slug    string
}
func (coilConfig *CoilConfig) isWriteOnly() bool {
	return coilConfig.Mode == Write
}
type Configuration struct {
	Coils           []CoilConfig
	MQTTBrokerURI   string `yaml:"mqtt_broker_uri"`
	MQTTClientID    string `yaml:"mqtt_client_id"`
	ModbusServerURI string `yaml:"modbus_server_uri"`
}
func (c *Configuration) filterCoilConfig() (filtered []CoilConfig) {
	for _, coilConfig := range c.Coils {
		if !coilConfig.isWriteOnly() {
			filtered = append(filtered, coilConfig)
		}
	}
	return
}
func (c *Configuration) CoilsList() (coils []Coil) {
	for _, coilConfig := range c.filterCoilConfig() {
		coils = append(coils, Coil{Address: coilConfig.Address, Slug: coilConfig.Slug, switchType: NO})
	}
	return
}