public IDictionary <object, object> ExecuteMacro(string uid)
        {
            if (uid == null)
            {
                throw new ArgumentNullException(nameof(uid));
            }

            MacroInstance macroInstance;

            lock (_macros)
            {
                if (!_macros.TryGetValue(uid, out macroInstance))
                {
                    return(new Dictionary <object, object>
                    {
                        ["type"] = WirehomeMessageType.ParameterInvalidException
                    });
                }
            }

            var result = macroInstance.TryExecute();

            _messageBusWrapper.PublishMacroExecutedBusMessage(uid, result);
            return(result);
        }
        public WirehomeDictionary ExecuteMacro(string uid)
        {
            if (uid == null)
            {
                throw new ArgumentNullException(nameof(uid));
            }

            MacroInstance macroInstance;

            lock (_macros)
            {
                if (!_macros.TryGetValue(uid, out macroInstance))
                {
                    return(new WirehomeDictionary().WithType(ControlType.ParameterInvalidException));
                }
            }

            var result = macroInstance.TryExecute();

            _messageBusWrapper.PublishMacroExecutedBusMessage(uid, result);
            return(result);
        }