(self, command)
eg
        {"command": "reset", "initiator": "admin", "time": 1609950197}
        {"command": "find", "initiator": "rmtApp", "time": 1612462418, "robot_id": null, "select_all": null}}}}'
eg
        {"command": "reset", "initiator": "admin", "time": 1609950197}
        {"command": "find", "initiator": "rmtApp", "time": 1612462418, "robot_id": null, "select_all": null}}}}'
eg { command : reset initiator : admin time : 1609950197 } { command : find initiator : rmtApp time : 1612462418 robot_id : null select_all : null }}}}
def _send_command(self, command):
        '''
        eg
        {"command": "reset", "initiator": "admin", "time": 1609950197}
        {"command": "find", "initiator": "rmtApp", "time": 1612462418, "robot_id": null, "select_all": null}}}}'
        '''
        self.log.info("Processing COMMAND: {}".format(command))
        if isinstance(command, dict):
            Command = command
        else:
            Command = {}
            try:
                Command = json.loads(command) #was command, object_pairs_hook=OrderedDict
            except json.decoder.JSONDecodeError:
                Command["command"] = command
        Command["time"] = self.totimestamp(datetime.datetime.now())
        Command["initiator"] = "localApp"
        myCommand = json.dumps(Command)
        self.log.info("Sending Command: {}".format(myCommand))
        self.client.publish("cmd", myCommand)
def _send_command ( self , command ) : self . log . info ( "Processing COMMAND: {}" . format ( command ) ) if isinstance ( command , dict ) : Command = command else : Command = { } try : Command = json . loads ( command ) #was command, object_pairs_hook=OrderedDict except json . decoder . JSONDecodeError : Command [ "command" ] = command Command [ "time" ] = self . totimestamp ( datetime . datetime . now ( ) ) Command [ "initiator" ] = "localApp" myCommand = json . dumps ( Command ) self . log . info ( "Sending Command: {}" . format ( myCommand ) ) self . client . publish ( "cmd" , myCommand )