Backup senica-RVO2 on 16.10.2025
This commit is contained in:
parent
8ccc3a848e
commit
186d55017f
101 changed files with 30952 additions and 0 deletions
43
RVO2/flow/virtualwirein.js
Executable file
43
RVO2/flow/virtualwirein.js
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
exports.id = 'virtualwirein';
|
||||
exports.title = 'Virtual wire in';
|
||||
exports.version = '1.0.0';
|
||||
exports.author = 'Martin Smola';
|
||||
exports.color = '#303E4D';
|
||||
exports.icon = 'sign-in';
|
||||
exports.input = false;
|
||||
exports.output = 1;
|
||||
exports.options = {};
|
||||
exports.readme = `# Virtual wire in
|
||||
|
||||
When the wires between the components are mess it's time to use Virtual wire.`;
|
||||
|
||||
exports.html = `<div class="padding">
|
||||
<div data-jc="textbox" data-jc-path="wirename" data-jc-config="required:true;placeholder:@(some identifier)" class="m">@(Wire name)</div>
|
||||
</div>
|
||||
<script>
|
||||
ON('save.virtualwirein', function(component, options) {
|
||||
!component.name && (component.name = options.wirename);
|
||||
});
|
||||
WATCH('settings.virtualwirein.wirename', function(path, value, type){
|
||||
if (type === 2)
|
||||
SET('settings.virtualwirein.wirename', value.slug());
|
||||
});
|
||||
</script>`;
|
||||
|
||||
exports.install = function(instance) {
|
||||
|
||||
instance.custom.reconfigure = function(options){
|
||||
if (instance.options.wirename) {
|
||||
instance.status(instance.options.wirename);
|
||||
} else
|
||||
instance.status('Not configured', 'red');
|
||||
};
|
||||
|
||||
ON('virtualwire', function(wirename, flowdata){
|
||||
if (instance.options.wirename && instance.options.wirename === wirename)
|
||||
instance.send(flowdata);
|
||||
});
|
||||
|
||||
instance.on('options', instance.custom.reconfigure);
|
||||
instance.custom.reconfigure();
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue