package channels

type FanState struct {
	Speed     *float64 `json:"speed,omitempty"`     // the speed of the fan as a percentage of maximum
	Direction *string  `json:"direction,omitempty"` // the direction of the fan: "forward" or "reverse"
}

type FanStatActuator interface {
	SetFanState(fanState *FanState) error
}

type FanStatChannel struct {
	baseChannel
	actuator FanStatActuator
}

func NewFanStatChannel(actuator FanStatActuator) *FanStatChannel {
	return &FanStatChannel{
		baseChannel: baseChannel{protocol: "fanstat"},
		actuator:    actuator,
	}
}

func (c *FanStatChannel) Set(fanState *FanState) error {
	return c.actuator.SetFanState(fanState)
}

func (c *FanStatChannel) SendState(fanState *FanState) error {
	//log.Printf("SendState: %+v\n, %p", fanState, c.SendEvent)
	return c.SendEvent("state", fanState)
}

package channels

import (
	"log"
)

type FanState struct {
	Speed     *float64 `json:"speed,omitempty"`     // the speed of the fan as a percentage of maximum
	Direction *string  `json:"direction,omitempty"` // the direction of the fan: "forward" or "reverse"
}

type FanStatActuator interface {
	SetFanState(fanState *FanState) error
}

type FanStatChannel struct {
	baseChannel
	actuator FanStatActuator
}

func NewFanStatChannel(actuator FanStatActuator) *FanStatChannel {
	return &FanStatChannel{
		baseChannel: baseChannel{protocol: "fanstat"},
		actuator:    actuator,
	}
}

func (c *FanStatChannel) Set(fanState *FanState) error {
	return c.actuator.SetFanState(fanState)
}

func (c *FanStatChannel) SendState(fanState *FanState) error {
	log.Printf("SendState: %+v\n, %p", fanState, c.SendEvent)
	return c.SendEvent("state", fanState)
}

--- 
+++ 
@@ -1,8 +1,4 @@
 package channels
-
-import (
-	"log"
-)
 
 type FanState struct {
 	Speed     *float64 `json:"speed,omitempty"`     // the speed of the fan as a percentage of maximum
@@ -30,6 +26,6 @@
 }
 
 func (c *FanStatChannel) SendState(fanState *FanState) error {
-	log.Printf("SendState: %+v\n, %p", fanState, c.SendEvent)
+	//log.Printf("SendState: %+v\n, %p", fanState, c.SendEvent)
 	return c.SendEvent("state", fanState)
 }
Clean up log message in FanStatChannel
