phone ping api flattened

This commit is contained in:
Senad Uka
2016-11-15 14:55:36 +01:00
parent 551471579f
commit cb32e1a9f7
2 changed files with 12 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
package com.zoblak.farmalarm;
/**
* Created by senadu on 11/15/16.
*/
public class AlarmPingResponse {
}

View File

@@ -46,7 +46,10 @@ Api.addRoute('alarm/:id/phonePing', {
var state = stateOrDefault(this.urlParams.id).state;
return {
'alarmTriggered': state['alarmTriggered'],
'alarmReasons': state['alarmReasons']
'tooHot': state['alarmReasons']['tooHot'],
'tooCold': state['alarmReasons']['tooCold'],
'phoneSilent': state['alarmReasons']['phoneSilent'],
'boxSilent': state['alarmReasons']['boxSilent']
}
}
});