feat: v2 event_count for Light/Door/Move/Reed; unified naming
This commit is contained in:
@@ -125,8 +125,6 @@ function summaryLine(d) {
|
||||
if ('vibration_status' in d) p.push(`vibration: ${d.vibration_status}`);
|
||||
if ('magnet_status' in d) p.push(`magnet: ${d.magnet_status}`);
|
||||
if ('event_count' in d && d.mode_id > 2) p.push(`${d.event_count} events`);
|
||||
if ('move_events' in d) p.push(`${d.move_events} moves`);
|
||||
if ('reed_events' in d) p.push(`${d.reed_events} reed events`);
|
||||
if ('fw_major' in d) p.push(`fw ${d.fw_major}.${d.fw_minor}`);
|
||||
if (p.length === 0) p.push('heartbeat');
|
||||
return p.join(' · ');
|
||||
@@ -220,7 +218,7 @@ const chartPresets = {
|
||||
Move: {
|
||||
subtitle: 'Cumulative movement events',
|
||||
datasets: (msgs) => [
|
||||
makeDs('Move events', msgs.map(m => m.decoded?.move_events ?? null), '#e11d48', 'y'),
|
||||
makeDs('Event count', msgs.map(m => m.decoded?.event_count ?? null), '#e11d48', 'y'),
|
||||
],
|
||||
},
|
||||
Magnet: {
|
||||
@@ -232,7 +230,7 @@ const chartPresets = {
|
||||
'Reed Switch': {
|
||||
subtitle: 'Cumulative reed switch events',
|
||||
datasets: (msgs) => [
|
||||
makeDs('Reed events', msgs.map(m => m.decoded?.reed_events ?? null), '#7c3aed', 'y'),
|
||||
makeDs('Event count', msgs.map(m => m.decoded?.event_count ?? null), '#7c3aed', 'y'),
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user