Backup senica-RVO53 on 16.10.2025
This commit is contained in:
parent
daa362b8aa
commit
429a705bb8
60 changed files with 28783 additions and 0 deletions
41
RVO53/flow/virtualwireout.js
Executable file
41
RVO53/flow/virtualwireout.js
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
exports.id = 'virtualwireout';
|
||||
exports.title = 'Virtual wire out';
|
||||
exports.version = '1.0.0';
|
||||
exports.author = 'Martin Smola';
|
||||
exports.color = '#303E4D';
|
||||
exports.icon = 'sign-out';
|
||||
exports.input = true;
|
||||
exports.options = {};
|
||||
exports.readme = `# Virtual wire out
|
||||
|
||||
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" class="m" data-jc-config="required:true;placeholder:@(some identifier)">@(Wire name)</div>
|
||||
</div>
|
||||
<script>
|
||||
ON('save.virtualwireout', function(component, options) {
|
||||
!component.name && (component.name = options.wirename);
|
||||
});
|
||||
WATCH('settings.virtualwireout.wirename', function(path, value, type){
|
||||
if (type === 2)
|
||||
SET('settings.virtualwireout.wirename', value.slug());
|
||||
});
|
||||
</script>`;
|
||||
|
||||
exports.install = function(instance) {
|
||||
|
||||
instance.custom.reconfigure = function(){
|
||||
if (instance.options.wirename) {
|
||||
instance.status(instance.options.wirename);
|
||||
} else
|
||||
instance.status('Not configured', 'red');
|
||||
};
|
||||
|
||||
instance.on('data', function(flowdata) {
|
||||
EMIT('virtualwire', instance.options.wirename, flowdata);
|
||||
});
|
||||
|
||||
instance.on('options', instance.custom.reconfigure);
|
||||
instance.custom.reconfigure();
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue