Update negate.js
This commit is contained in:
parent
25fc9cfda5
commit
53545ba248
1 changed files with 2 additions and 9 deletions
|
|
@ -4,23 +4,19 @@ export default {
|
|||
bytecodeKey: "negate",
|
||||
name: "Negate",
|
||||
colour: 60,
|
||||
description: "Swaps a truthy value to `false`, or a falsy value to `true`.",
|
||||
|
||||
description: "Flip any condition to its opposite - turns true into false and false into true. Essential for creating inverse logic like 'if NOT raining', 'if door is NOT open', or 'if temperature is NOT above 75°F'. Perfect for building exception handling, safety conditions, and reverse automation logic in your IoT Actions.",
|
||||
connections: {
|
||||
mode: "value",
|
||||
output: "expression",
|
||||
},
|
||||
|
||||
template: "not %EXPRESSION",
|
||||
|
||||
inputs: {
|
||||
EXPRESSION: {
|
||||
description: "Block diagram that will be resolved, then have its truthiness flipped.",
|
||||
description: "Connect any condition or comparison that you want to reverse. Examples: attach 'temperature > 80' to create 'NOT temperature > 80' (meaning temperature ≤ 80), or 'motion detected' to create 'NOT motion detected' (meaning no motion).",
|
||||
check: "expression",
|
||||
shadow: 'io_logic_boolean'
|
||||
}
|
||||
},
|
||||
|
||||
generators: {
|
||||
json: (block, generator) => {
|
||||
const
|
||||
|
|
@ -30,15 +26,12 @@ export default {
|
|||
target: JSON.parse(operand)
|
||||
}
|
||||
}
|
||||
|
||||
return [ JSON.stringify(payload), 0 ]
|
||||
}
|
||||
},
|
||||
|
||||
regenerators: {
|
||||
json: (blockObject, helpers) => {
|
||||
const payload = blockObject.negate
|
||||
|
||||
return {
|
||||
type: 'io_logic_negate',
|
||||
inputs: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue