feat(x4): add per-camera manual wake and hide power action when connected

This commit is contained in:
DCCONSTRUCTIONS
2026-09-10 16:27:48 +03:00
parent db14ee5435
commit 99f29218d7
27 changed files with 992 additions and 126 deletions
@@ -1,7 +1,16 @@
import type {Sensor} from '../../../../packages/sensor-ui/src/contracts';
import type {SensorRowAction} from '../../../../packages/sensor-ui/src/extensions';
export interface RecoveryStatus {
supported:boolean; enabled:boolean; preview_wanted:boolean; phase:string;
wake_available?:boolean;
}
export function cameraRowActions(device:Sensor):readonly SensorRowAction[] {
if(device.online||!cameraStatus(device).recovery?.supported)return [];
return [{actionId:'power.wake',label:'Включить',
description:'На X4 должно быть включено «Пробуждение по Bluetooth». USB оставьте подключённым.',
disabled:!device.prepared||!(device.configured??device.snapshot.enrollment==='enrolled')||cameraStatus(device).recovery?.wake_available!==true}];
}
export interface CameraStatus {
+2 -1
View File
@@ -1,8 +1,9 @@
import type {SensorUiContribution} from '../../../../packages/sensor-ui/src/extensions';
import {X4Detail} from './X4Detail';
import {cameraLabel} from './model';
import {cameraLabel,cameraRowActions} from './model';
export const insta360X4SensorUi:SensorUiContribution={
kind:'insta360.x4',Detail:X4Detail,icon:'camera',retainOffline:true,
supportsPreparation:true,supportsRenaming:true,status:cameraLabel,
rowActions:cameraRowActions,
};