Merge pull request #31 from adafruit/tylerdcooper-patch-9

docs: text block update
This commit is contained in:
Loren Norman 2025-08-19 13:44:53 -04:00 committed by GitHub
commit d1cb0d0ec6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,25 +3,21 @@ export default {
type: "io_text", type: "io_text",
name: "Text", name: "Text",
colour: 180, colour: 180,
description: "A String of text", description: "Enter any text content for use in your Actions - words, phrases, device commands, or messages. Perfect for setting device states ('on', 'off'), creating notification messages ('Alert: High temperature detected'), defining comparison values ('motion detected'), or sending commands to connected systems. The building block for all text-based automation and communication.",
connections: { connections: {
mode: "value", mode: "value",
output: [ "expression", "string" ], output: [ "expression", "string" ],
}, },
template: `"%TEXT`, template: `"%TEXT`,
fields: { fields: {
TEXT: { TEXT: {
description: "Type your text content here. Examples: 'on' for device commands, 'High temperature alert!' for notifications, 'motion' for sensor state matching, email subjects like 'Daily Report', or any words/phrases your automation needs. Single line text only - use Multiline Text block for paragraphs.",
text: '' text: ''
} }
}, },
generators: { generators: {
json: block => { json: block => {
const text = block.getFieldValue('TEXT') const text = block.getFieldValue('TEXT')
return [ JSON.stringify(text), 0 ] return [ JSON.stringify(text), 0 ]
} }
} }