UNPKG

@irusland/homebridge-mqttthing

Version:

Homebridge plugin supporting various services over MQTT (with TLS fixes)

27 lines (24 loc) 572 B
/** * Test 'toggle' codec - toggles switch on receipt of any message * toggle.js */ 'use strict' module.exports = { init: function() { let state = false; return { properties: { on: { decode: function() { state = ! state; return state; }, encode: function( msg ) { state = msg; return msg; } } } }; } };