patchbayUiKeepAwakeSetCommandDescriptor top-level property

PatchbayCommandDescriptor patchbayUiKeepAwakeSetCommandDescriptor
final

Implementation

final patchbayUiKeepAwakeSetCommandDescriptor = _ui(
  'ui.keepAwake.set',
  'Hold the screen awake under a bounded lease, or release it.',
  facts: _appFacts,
  parameters: <PatchbayParameterDescriptor>[
    _p('enabled', PatchbayParameterType.boolean, required: true),
    const PatchbayParameterDescriptor(
      name: 'leaseMs',
      type: PatchbayParameterType.integer,
      defaultValue: 600000,
      summary:
          'Lease for this engagement; the App releases on its own when it '
          'runs out. Only valid with enabled: true.',
    ),
  ],
  cliSyntax: const <PatchbayCliSyntax>[
    PatchbayCliSyntax(
      id: 'uiKeepAwakeOn',
      path: <String>['ui', 'keep-awake', 'on'],
      summary: 'Ask the App to hold the screen awake for one bounded lease.',
      usageSuffix: '[--lease-ms <ms>]',
      optionParameters: <String, String>{'leaseMs': 'lease-ms'},
      positiveParameters: <String>{'leaseMs'},
      omitOptionDefaults: <String>{'leaseMs'},
      fixedArguments: <String, Object?>{'enabled': true},
    ),
    PatchbayCliSyntax(
      id: 'uiKeepAwakeOff',
      path: <String>['ui', 'keep-awake', 'off'],
      summary:
          'Release the keep-awake hold now, without waiting for the lease.',
      fixedArguments: <String, Object?>{'enabled': false},
    ),
  ],
);