Update boolean.js

This commit is contained in:
Tyler Cooper 2025-08-19 09:36:44 -05:00 committed by GitHub
parent 55e3b09415
commit 86a3ac24ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,28 +3,24 @@ export default {
type: 'io_logic_boolean',
name: "Boolean",
colour: 60,
description: "A true or false value.",
description: "A simple true or false value for building logic conditions and controlling digital outputs. Use 'true' to turn things on, enable conditions, or represent 'yes' states. Use 'false' to turn things off, disable conditions, or represent 'no' states. Essential for controlling relays, LEDs, alarms, and any on/off IoT devices.",
connections: {
mode: "value",
output: [ "expression", "boolean" ],
},
template: "%BOOL",
fields: {
BOOL: {
description: "Choose the boolean state you want to use:",
options: [
['true', 'TRUE'],
['false', 'FALSE'],
['true', 'TRUE', "Represents 'on', 'yes', 'enabled', or 'active' state. Use for turning on devices, enabling features, or setting positive conditions."],
['false', 'FALSE', "Represents 'off', 'no', 'disabled', or 'inactive' state. Use for turning off devices, disabling features, or setting negative conditions."],
]
}
},
generators: {
json: block => {
const bool = block.getFieldValue('BOOL') === 'TRUE'
return [ JSON.stringify(bool), 0 ]
}
}