fix: select live range and route telemetry

This commit is contained in:
seo-amugae committed 2026-10-18 16:59:15 +09:00
1 parent edf38a410b
commit 5f7f4397a0
3 files changed
+10 -8

No files matched your search

+2 -3
View File
@@ -62,7 +62,7 @@ final class NiroTelemetrySnapshot
'camera' => 'system_individualdrivemode_fron_rear_camera_status',
'drive_mode' => 'system_individualdrivemode_mcurrentdrivemode',
'fuel_warning' => 'system_root_fuelwarning',
'distance_to_empty' => 'system_individualdrivemode_distance_to_empty',
'distance_to_empty' => 'hev_micom_hevstatus_mtotaldte',
'battery_soc_12v' => 'system_root_mbatterysoc',
'battery_above_60' => 'system_root_mbattery60above',
'ldc_battery' => 'system_root_ldcbatterystate',
@@ -98,10 +98,9 @@ final class NiroTelemetrySnapshot
'blower_level' => 'datc_micom_datcstatus_mmainblowerlevel',
'intake_mode' => 'datc_micom_datcstatus_mintake',
'co2_warning' => 'datc_micom_datcstatus_mco2warning',
'route_guide' => 'system_individualdrivemode_route_guide',
'route_guide' => 'cluster_tbt_info_operationstatus',
'next_turn_distance' => 'cluster_tbt_subinfo_distance',
'speed_limit' => 'cluster_slif_navi_info_speed_limit',
'off_route' => 'cluster_scc_hu_p_info_offroutestatus',
'camera_distance' => 'cluster_scc_hu_p_info_rangecamdist',
'camera_speed_limit' => 'cluster_scc_hu_p_info_rangecamspdlimit',
'av_power' => 'power_root_av_power_status',
+3 -3
View File
@@ -3124,13 +3124,13 @@ $carMonitorSession = car_monitor_launcher_session();
set('tm-next-turn', rawState('next_turn_distance'));
const speedLimit = numeric('speed_limit');
set('tm-speed-limit', speedLimit === null ? null : `${speedLimit} km/h`);
set('tm-off-route', rawState('off_route'));
set('tm-off-route', null);
const cameraDistance = numeric('camera_distance');
set('tm-camera-distance', cameraDistance === null ? null : `${cameraDistance.toLocaleString()} m`);
set('tm-camera-limit', rawState('camera_speed_limit'));
set('tm-camera-limit', cameraDistance === null ? null : rawState('camera_speed_limit'));
set('tm-micom', onOff('micom_connected'));
const boot = onOff('boot_sequence_finished') ?? onOff('boot_completed');
const boot = onOff('boot_completed');
set('tm-boot', boot);
set('tm-power', rawState('head_unit_power'));
set('tm-av-power', rawState('av_power'));
+5 -2
View File
@@ -32,24 +32,27 @@ $summary = NiroTelemetrySnapshot::summarize([
'system_individualdrivemode_vehicle_speed' => '0',
'system_individualdrivemode_gear_status' => 'P(0x0)',
'system_root_mbatterysoc' => '93',
'hev_micom_hevstatus_mtotaldte' => '761',
'hev_micom_hevstatus_mdisplaysoc' => '255',
'hev_micom_hevstatus_odometer' => '2596537',
'bcm_micom_bcmstatus_mdrvopenedstate' => '0',
'datc_micom_datcstatus_mambienttempc' => '25.0',
'mode_root_current_mode_real' => 'BLUETOOTH STREAMING (0x36)',
'cluster_tbt_info_operationstatus' => '1',
],
], ['stale_after' => 20]);
check($summary['available'] === true, 'snapshot is available');
check($summary['online'] === true, 'availability topic is respected');
check($summary['stale'] === false, 'fresh sample is not stale');
check($summary['metric_count'] === 13, 'metric count excludes sample epoch');
check($summary['metric_count'] === 15, 'metric count excludes sample epoch');
check($summary['services'] === ['available' => 1, 'total' => 2], 'service health is counted');
check($summary['metrics']['speed']['value'] === '27', 'speed mapping');
check($summary['metrics']['gear']['value'] === '5', 'live root gear mapping');
check($summary['metrics']['outside_temperature']['value'] === '25.0', 'climate mapping');
check($summary['metrics']['driver_door']['supported'] === true, 'zero is supported');
check($summary['metrics']['distance_to_empty']['supported'] === false, 'missing value is unsupported');
check($summary['metrics']['distance_to_empty']['value'] === '761', 'live HEV range mapping');
check($summary['metrics']['route_guide']['value'] === '1', 'live cluster route state mapping');
check(!array_key_exists('state', $summary), 'raw snapshot is not exposed');
$stale = NiroTelemetrySnapshot::summarize([