7/16/2014 - 3:10 PM


exports.sensorHubEvent = (sensorHubEvent, eventResolved) ->
  alertText = switch sensorHubEvent
    when 1 then 'Water detect'
    when 2 then 'Motion detect'
    when 3 then 'Low temperature'
    when 4 then 'High temperature'
    when 5 then 'Low humidity'
    when 6 then 'High humidity'
    when 7 then 'Low light'
    when 8 then 'High light'
  if eventResolved
    alertText += ' resolved'

exports.gatewayEvent = (message) ->
  switch gatewayEventCode
    when 1 then 'Going from line power to backup battery'
    when 2 then 'Going from backup battery to line power'
    when 3 then 'Transition from high to low battery voltage'
    when 4 then 'Transition from low to critical low battery voltage'
    when 5 then 'Going from shipping/dead to power on (SDG connected to line power)'
    when 6 then 'Heartbeat'