extensions/web-scripts/blocks.json
Rama master · réplica de lectura del repositorio original.
{
"lha_get_data": {
"tooltip" : "Gets a thing property value",
"message0": "get %1",
"args0": [{
"type": "field_dropdown",
"name": "PATH",
"options": "$getThingPathOptions"
}],
"output": null,
"colour": "$lhaDataColor"
},
"lha_set_data": {
"tooltip" : "Sets a thing property value",
"message0": "set %1 %2",
"args0": [{
"type": "field_dropdown",
"name": "PATH",
"options": "$setThingPathOptions"
}, {
"type": "input_value",
"name": "VALUE"
}],
"previousStatement": null,
"nextStatement": null,
"colour": "$lhaDataColor"
},
"lha_watch_data": {
"tooltip" : "Triggers an action on a thing property value change",
"message0": "watch %1",
"args0": [{
"type": "field_dropdown",
"name": "PATH",
"options": "$eventThingPathOptions"
}],
"message1": "new: %1",
"args1": [{
"type": "field_variable",
"name": "NEW_VALUE",
"variable": "value"
}],
"message2": "do %1",
"args2": [{
"type": "input_statement",
"name": "DO"
}],
"inputsInline": true,
"colour": "$lhaDataColor"
},
"lha_event": {
"tooltip" : "Triggers an action on an event",
"message0": "on %1",
"args0": [{
"type": "field_dropdown",
"name": "EVENT",
"options": "$lhaEventNames"
}],
"message1": "do %1",
"args1": [{
"type": "input_statement",
"name": "DO"
}],
"colour": "$lhaEventColor"
},
"lha_schedule": {
"tooltip" : "Triggers an action on a schedule, minutes hours days months weekdays, ex: */5 1,3 2-4",
"message0": "every %1",
"args0": [{
"type": "field_input",
"name": "VALUE",
"text": "0 0 * * *"
}],
"message1": "do %1",
"args1": [{
"type": "input_statement",
"name": "DO"
}],
"colour": "$lhaEventColor"
},
"lha_timer": {
"tooltip" : "Triggers an action after a delay",
"message0": "set timer %1",
"args0": [{
"type": "field_input",
"name": "NAME",
"text": "my timer"
}],
"message1": "in %1 %2",
"args1": [{
"type": "field_input",
"name": "VALUE",
"text": "1"
}, {
"type": "field_dropdown",
"name": "SECONDS",
"options": [
[ "seconds", "1" ],
[ "minutes", "60" ],
[ "hours", "3600" ]
]
}],
"message2": "do %1",
"args2": [{
"type": "input_statement",
"name": "DO"
}],
"inputsInline": true,
"previousStatement": null,
"nextStatement": null,
"colour": "$lhaEventColor"
},
"lha_clear_timer": {
"tooltip" : "Clears a timer",
"message0": "clear timer %1",
"args0": [{
"type": "field_input",
"name": "NAME",
"text": "my timer"
}],
"previousStatement": null,
"nextStatement": null,
"colour": "$lhaEventColor"
},
"lha_to_string": {
"tooltip" : "A string representing the value",
"message0": "to string %1",
"args0": [{
"type": "input_value",
"name": "VALUE"
}],
"output": null,
"colour": "$lhaExpressionColor"
},
"lha_type": {
"tooltip" : "The type of the value, string/number/boolean/table",
"message0": "type %1",
"args0": [{
"type": "input_value",
"name": "VALUE"
}],
"output": null,
"colour": "$lhaExpressionColor"
},
"lha_time": {
"tooltip" : "The current time in seconds since epoch",
"message0": "time",
"args0": [],
"output": null,
"colour": "$lhaExpressionColor"
},
"lha_hms": {
"tooltip" : "A decimal hour, h.ms",
"message0": "hour %1",
"args0": [{
"type": "field_input",
"name": "VALUE",
"text": "00:00"
}],
"output": null,
"colour": "$lhaExpressionColor"
},
"lha_day": {
"tooltip" : "A weekday, from 0 to 6",
"message0": "%1",
"args0": [{
"type": "field_dropdown",
"name": "NAME",
"options": [
[ "sunday", "0" ],
[ "monday", "1" ],
[ "tuesday", "2" ],
[ "wednesday", "3" ],
[ "thursday", "4" ],
[ "friday", "5" ],
[ "saturday", "6" ]
]
}],
"output": null,
"colour": "$lhaExpressionColor"
},
"lha_parse_time": {
"tooltip" : "The time in seconds since epoch corresponding to the ISO 8601 string value",
"message0": "parse date time from %1",
"args0": [{
"type": "input_value",
"name": "VALUE"
}],
"output": null,
"colour": "$lhaExpressionColor"
},
"lha_format_time": {
"tooltip" : "The ISO 8601 date from the time in seconds since epoch",
"message0": "format date time from %1",
"args0": [{
"type": "input_value",
"name": "VALUE"
}],
"output": null,
"colour": "$lhaExpressionColor"
},
"lha_date": {
"tooltip" : "The date time field value from the time in seconds since epoch",
"message0": "date field %1 from %2",
"args0": [{
"type": "field_dropdown",
"name": "FIELD",
"options": [
[ "hours (decimal)", "H.ms" ],
[ "weekday (0-6)", "w" ],
[ "month (1-12)", "m" ],
[ "day", "d" ],
[ "hours", "H" ],
[ "minutes", "M" ],
[ "seconds", "S" ],
[ "yearweek (0-53)", "W" ],
[ "year", "Y" ]
]
}, {
"type": "input_value",
"name": "VALUE"
}],
"output": null,
"colour": "$lhaExpressionColor"
},
"lha_color": {
"tooltip" : "The color component from 0 to 1",
"message0": "color component %1 from %2",
"args0": [{
"type": "field_dropdown",
"name": "FIELD",
"options": [
[ "red", "r" ],
[ "green", "g" ],
[ "blue", "b" ],
[ "hue", "h" ],
[ "saturation", "s" ],
[ "value", "v" ]
]
}, {
"type": "input_value",
"name": "VALUE"
}],
"output": null,
"colour": "$lhaExpressionColor"
},
"lha_color_hsv": {
"tooltip" : "The color from HSV components",
"message0": "hsv %1 %2 %3",
"args0": [{
"type": "input_value",
"name": "HUE"
}, {
"type": "input_value",
"name": "SATURATION"
}, {
"type": "input_value",
"name": "VALUE"
}],
"inputsInline": true,
"output": null,
"colour": "$lhaExpressionColor"
},
"lha_color_rgb": {
"tooltip" : "The color from RGB components",
"message0": "rgb %1 %2 %3",
"args0": [{
"type": "input_value",
"name": "RED"
}, {
"type": "input_value",
"name": "GREEN"
}, {
"type": "input_value",
"name": "BLUE"
}],
"inputsInline": true,
"output": null,
"colour": "$lhaExpressionColor"
},
"lha_log": {
"tooltip" : "Logs the specified message",
"message0": "log %1 %2",
"args0": [{
"type": "field_dropdown",
"name": "LEVEL",
"options": [
[ "error", "ERROR" ],
[ "warn", "WARN" ],
[ "info", "INFO" ],
[ "config", "CONFIG" ],
[ "fine", "FINE" ],
[ "finer", "FINER" ],
[ "finest", "FINEST" ]
]
}, {
"type": "input_value",
"name": "MESSAGE",
"check": "String"
}],
"previousStatement": null,
"nextStatement": null,
"colour": "$lhaExperimentalColor"
},
"lha_on_event": {
"tooltip" : "Triggers an action on a custom event",
"message0": "on %1",
"args0": [{
"type": "field_input",
"name": "EVENT",
"check": "String",
"text": "custom event"
}],
"message1": "new: %1",
"args1": [{
"type": "field_variable",
"name": "ARGS",
"variable": "args"
}],
"message2": "do %1",
"args2": [{
"type": "input_statement",
"name": "DO"
}],
"inputsInline": true,
"colour": "$lhaExperimentalColor"
},
"lha_fire_event": {
"tooltip" : "Fires a custom event",
"message0": "fire %1 to %2 with %3",
"args0": [{
"type": "field_input",
"name": "EVENT",
"text": "custom event"
}, {
"type": "field_dropdown",
"name": "TARGET",
"options": [
[ "me", "ME" ],
[ "others", "OTHERS" ],
[ "all", "ALL" ]
]
}, {
"type": "input_value",
"name": "ARGS",
"check": "Array"
}],
"previousStatement": null,
"nextStatement": null,
"colour": "$lhaExperimentalColor"
},
"lha_data_path": {
"tooltip" : "The path corresponding to the thing property",
"message0": "%1",
"args0": [{
"type": "field_dropdown",
"name": "PATH",
"options": "$eventThingPathOptions"
}],
"output": null,
"colour": "$lhaExperimentalColor"
},
"lha_get_data_path": {
"tooltip" : "Gets a thing property value by its path",
"message0": "get %1",
"args0": [{
"type": "input_value",
"name": "PATH"
}],
"output": null,
"colour": "$lhaExperimentalColor"
},
"lha_set_data_path": {
"tooltip" : "Sets a thing property value by its path",
"message0": "set %1 to %2",
"args0": [{
"type": "input_value",
"name": "PATH"
}, {
"type": "input_value",
"name": "VALUE"
}],
"inputsInline": true,
"previousStatement": null,
"nextStatement": null,
"colour": "$lhaExperimentalColor"
},
"lha_get_field": {
"tooltip" : "Gets a field value from an object",
"message0": "get %1 field %2",
"args0": [{
"type": "field_variable",
"name": "OBJECT"
}, {
"type": "field_input",
"name": "NAME",
"text": "name"
}],
"output": null,
"colour": "$lhaExperimentalColor"
},
"lha_set_field": {
"tooltip" : "Sets a field value to an object",
"message0": "set %1 field %2 to %3",
"args0": [{
"type": "field_variable",
"name": "OBJECT"
}, {
"type": "field_input",
"name": "NAME",
"text": "name"
}, {
"type": "input_value",
"name": "VALUE"
}],
"previousStatement": null,
"nextStatement": null,
"colour": "$lhaExperimentalColor"
},
"lha_require": {
"tooltip" : "Requires a module by its name",
"message0": "require %1",
"args0": [{
"type": "field_input",
"name": "NAME",
"text": "name"
}],
"output": null,
"colour": "$lhaExperimentalColor"
},
"lha_call": {
"tooltip" : "Calls a function with an argument list",
"message0": "call %1 with %2",
"args0": [{
"type": "input_value",
"name": "FUNCTION"
}, {
"type": "input_value",
"name": "ARGS",
"check": "Array"
}],
"output": null,
"colour": "$lhaExperimentalColor"
},
"lha_call_no_return": {
"tooltip" : "Calls a function with an argument list",
"message0": "call %1 with %2",
"args0": [{
"type": "input_value",
"name": "FUNCTION"
}, {
"type": "input_value",
"name": "ARGS",
"check": "Array"
}],
"previousStatement": null,
"nextStatement": null,
"colour": "$lhaExperimentalColor"
}
}