def _understand(self, original_command, action, parameters, fulfillment): logger.debug('ORIGINAL_COMMAND {}'.format(original_command)) operations = [ minion.understanding.operations.UnderstandingOperation(self.get_configuration('lirc_channel', 'minion:lirc'), 'tv KEY_POWER'), ] if self._get_acknowledge() and fulfillment and fulfillment.get('speech', ''): ack = fulfillment['speech'] operations.append(minion.understanding.operations.UnderstandingOperation('minion:speak', '{prefix} {ack}'.format(prefix=self.get_configuration('fulfillment_prefix', ''), ack=ack)),) return operations
def _understand(self, original_command, action, parameters, fulfillment): key = self._build_key(**parameters) operations = [ minion.understanding.operations.UnderstandingOperation(self.get_configuration('memory_channel', 'minion:committomemory'), 'set {key} {value}'.format(key=key, value=parameters['number'])), ] if self.get_configuration('acknowledge', False) and fulfillment and fulfillment.get('speech', ''): ack = fulfillment['speech'] operations.append(minion.understanding.operations.UnderstandingOperation('minion:speak', '{prefix} {ack}'.format(prefix=self.get_configuration('fulfillment_prefix', ''), ack=ack)),) # Send to what we expect is a commit to memory return operations
def _understand(self, original_command, action, parameters, fulfillment): key = self._build_key(**parameters) operations = [ minion.understanding.operations.UnderstandingOperation( self.get_configuration('memory_channel', 'minion:committomemory'), 'set {key} {value}'.format(key=key, value=parameters['number'])), ] if self.get_configuration('acknowledge', False) and fulfillment and fulfillment.get( 'speech', ''): ack = fulfillment['speech'] operations.append( minion.understanding.operations.UnderstandingOperation( 'minion:speak', '{prefix} {ack}'.format(prefix=self.get_configuration( 'fulfillment_prefix', ''), ack=ack)), ) # Send to what we expect is a commit to memory return operations