MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / booleanDef

Function booleanDef

src/lib/item-input/misc.ts:110–116  ·  view source on GitHub ↗
(name: string, options?: BooleanDefOptions)

Source from the content-addressed store, hash-verified

108
109export type BooleanDefOptions = BooleanInputOptions
110export const booleanDef = (name: string, options?: BooleanDefOptions): InputDefinition<boolean> => {
111 const buildFromUserInput = async (): Promise<boolean> => booleanInput(name, options)
112 const summarizeForEdit = (value: boolean): string => value ? 'Yes' : 'No'
113 const updateFromUserInput = async (original: boolean): Promise<boolean> => booleanInput(name, { default: original })
114
115 return { name, buildFromUserInput, summarizeForEdit, updateFromUserInput }
116}
117
118/**
119 * Use a static definition if you only need a hard-coded value for a given field. The user will

Callers 2

buildInputDefinitionFunction · 0.85
misc.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected