Created
July 16, 2014 15:10
-
-
Save easierbycode/8cac50cb5db39b6b0b1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
alertText | |
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' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment