def prepare_message(self, data=None):
message = {<EOL>'<STR_LIT>': self.protocol,<EOL>'<STR_LIT>': self._node,<EOL>'<STR_LIT>': self._chip_id,<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': {},<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': [<EOL>'<STR_LIT>'<EOL>]<EOL>}<EOL>if type(data) is dict:<EOL><INDENT>for k, v in data.items():<EOL><INDENT>if k in message:<EOL><INDENT>message[k] = v<EOL><DEDENT><DEDENT><DEDENT>return message<EOL>
Return message as dict
:return dict