Display if the door is open

This commit is contained in:
Tanner Collin 2021-09-08 03:34:12 +00:00
parent c2705338f5
commit e1aea8efcf

View File

@ -166,6 +166,8 @@ export function Home(props) {
const alarmStat = () => stats && stats.alarm && moment().unix() - stats.alarm['time'] < 300 ? stats.alarm['data'] < 270 ? 'Armed' : 'Disarmed' : 'Unknown';
const doorOpenStat = () => alarmStat() == 'Disarmed' && stats.alarm['data'] > 360 ? ', door open' : '';
const show_signup = stats?.at_protospace || bypass_code;
return (
@ -283,7 +285,7 @@ export function Home(props) {
} trigger={<a>[more]</a>} />
</p>
{user && user.member.vetted_date && <p>Alarm status: {alarmStat()}</p>}
{user && user.member.vetted_date && <p>Alarm status: {alarmStat()}{doorOpenStat()}</p>}
</div>
</Segment>