Module: fan

Simple on/off control of the extractor fan. Every time the state changes (on/off) an event is emitted to all listeners.
Author:
  • Dave Leitch

Requires

  • module:brewdefs.js
  • module:brewlog.js
  • module:i2c.js
  • module:events

Members


<static> isOn


<inner> currentState

Current state of the Fan (on/off)

<inner, constant> FAN_DEF

Definitions for the fan.
Properties:
Name Type Description
name string Unique fan name.
i2cPinOut number I2C pin number connected to the fan.

<inner, constant> FAN_OFF :number

I2C value used to switch ON the pump.
Type:
  • number

<inner, constant> FAN_ON :number

I2C value used to switch OFF the pump.
Type:
  • number

Methods


<static> start()

Add listener to kettle temp and emit fan events when switching on and off.

<static> stop()

Remove kettle temp listener and fan event.

<static> switchOff()

Turn off the fan.
Fires:
  • event:fanEvent

<static> switchOn()

Turn on the fan.
Fires:
  • event:fanEvent

<inner> isOn()

Returns:
currentState.
Type
boolean

<inner> setState(state)

Switch fan on or off
Parameters:
Name Type Description
state number on or off

<inner> tempKettleListener(data)

Automatically switch on/off fan with temperature
Parameters:
Name Type Description
data Object Data from sensor.