Display if the door is open
This commit is contained in:
parent
c2705338f5
commit
e1aea8efcf
|
@ -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 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;
|
const show_signup = stats?.at_protospace || bypass_code;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -283,7 +285,7 @@ export function Home(props) {
|
||||||
} trigger={<a>[more]</a>} />
|
} trigger={<a>[more]</a>} />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{user && user.member.vetted_date && <p>Alarm status: {alarmStat()}</p>}
|
{user && user.member.vetted_date && <p>Alarm status: {alarmStat()}{doorOpenStat()}</p>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</Segment>
|
</Segment>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user