feat(x4): add per-camera manual wake and hide power action when connected
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user